Closed Bug 1833180 Opened 2 years ago Closed 2 years ago

Query string is not parsed correctly into parameters

Categories

(DevTools :: Netmonitor, defect)

61 Branch
defect

Tracking

(Not tracked)

RESOLVED INVALID

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: =

= 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"
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.