Bug 1363553 - Do not decode url before parsing query string. r=Honza, a=gchang
authorRicky Chien <ricky060709@gmail.com>
Thu, 18 May 2017 23:04:35 +0800
changeset 585403 cd589e5aabd45c7785cf0970a01fa29cee6925f1
parent 585402 adb1f8ff7655660d862286c4949f6f606c8d0d77
child 585404 38c9c1ad194a58d08440919f0c4618993917315b
push id61106
push userbmo:dkeeler@mozilla.com
push dateFri, 26 May 2017 21:26:31 +0000
reviewersHonza, gchang
bugs1363553
milestone54.0
Bug 1363553 - Do not decode url before parsing query string. r=Honza, a=gchang MozReview-Commit-ID: 6GZjI8UybuA
devtools/client/netmonitor/test/head.js
devtools/client/netmonitor/utils/request-utils.js
--- a/devtools/client/netmonitor/test/head.js
+++ b/devtools/client/netmonitor/test/head.js
@@ -289,17 +289,18 @@ function verifyRequestItemTarget(documen
   if (fuzzyUrl) {
     ok(target.querySelector(".requests-list-file").textContent.startsWith(
       name + (query ? "?" + query : "")), "The displayed file is correct.");
     ok(target.querySelector(".requests-list-file").getAttribute("title")
                                                   .startsWith(unicodeUrl),
       "The tooltip file is correct.");
   } else {
     is(target.querySelector(".requests-list-file").textContent,
-      name + (query ? "?" + query : ""), "The displayed file is correct.");
+      decodeURIComponent(name + (query ? "?" + query : "")),
+      "The displayed file is correct.");
     is(target.querySelector(".requests-list-file").getAttribute("title"),
       unicodeUrl, "The tooltip file is correct.");
   }
 
   is(target.querySelector(".requests-list-domain").textContent,
     hostPort, "The displayed domain is correct.");
 
   let domainTooltip = hostPort + (remoteAddress ? " (" + remoteAddress + ")" : "");
--- a/devtools/client/netmonitor/utils/request-utils.js
+++ b/devtools/client/netmonitor/utils/request-utils.js
@@ -133,17 +133,17 @@ function getUrlBaseName(url) {
 
 /**
  * Helpers for getting the query portion of a url.
  *
  * @param {string} url - url string
  * @return {string} unicode query of a url
  */
 function getUrlQuery(url) {
-  return decodeUnicodeUrl((new URL(url)).search.replace(/^\?/, ""));
+  return (new URL(url)).search.replace(/^\?/, "");
 }
 
 /**
  * Helpers for getting unicode name and query portions of a url.
  *
  * @param {string} url - url string
  * @return {string} unicode basename and query portions of a url
  */