Query string is not parsed correctly into parameters
Categories
(DevTools :: Netmonitor, defect)
Tracking
(Not tracked)
People
(Reporter: bzakaria, Unassigned, Mentored)
Details
+++ This bug was initially created as a clone of Bug #1481732 +++
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/112.0
Description
params are not parsed correctly in one special case, where the value equals '='
This is not a bug in the devtools only, I actually get an empty value instead of '=' in my backend.
Steps to reproduce:
Send GET request where query string contains a param with the value '=', e.g. ...&species==&...
Actual results:
Parameters are not parsed correctly and displayed in the Params tab:
species:
Expected results:
should be:
species: =
Comment 1•2 years ago
|
||
= needs to be encoded for it to be valid
encodeURIComponent("=") will give you %3D
So when building your url, you should pass mypage?species=%3D
You can use URLSearchParams so the value will be properly encoded
url = `mypage?${new URLSearchParams({species: "="})}` // "mypage?species=%3D"
Description
•