Bug 1970654 - [devtools] Fix new request params sync for parameters with same name. a=dmeehan. DONTBUILD

Original Revision: https://phabricator.services.mozilla.com/D253126

Differential Revision: https://phabricator.services.mozilla.com/D253309
This commit is contained in:
Nicolas Chevobbe
2025-06-11 17:01:27 +00:00
committed by dmeehan@mozilla.com
parent c176345db2
commit e348ab993b
2 changed files with 14 additions and 1 deletions

View File

@@ -274,7 +274,7 @@ class HTTPCustomRequestPanel extends Component {
for (const { name, value, checked } of urlQueryParams) {
// We only want to add checked parameters with a non-empty name
if (checked && name) {
searchParams.set(name, value);
searchParams.append(name, value);
}
}

View File

@@ -115,6 +115,19 @@ add_task(async function () {
expectedInputValueAfterAddingParamValue: `${HTTPS_CUSTOM_GET_URL}?a=3&b=4&My-param=my-value`,
expectedInputValueAfterUncheckingParam: `${HTTPS_CUSTOM_GET_URL}?a=3&b=4`,
},
{
url: HTTPS_CUSTOM_GET_URL,
queryString: "?a=3&a=4&b=5",
expectedParametersSize: 3,
expectedParameters: [
{ name: "a", value: "3" },
{ name: "a", value: "4" },
{ name: "b", value: "5" },
],
expectedInputValueAfterAddingParamName: `${HTTPS_CUSTOM_GET_URL}?a=3&a=4&b=5&My-param=`,
expectedInputValueAfterAddingParamValue: `${HTTPS_CUSTOM_GET_URL}?a=3&a=4&b=5&My-param=my-value`,
expectedInputValueAfterUncheckingParam: `${HTTPS_CUSTOM_GET_URL}?a=3&a=4&b=5`,
},
// Checking with an invalid URL string
{
url: "invalid",