Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Comment special treatment of '+' in URL query parsing

David da Silva73929ad85143
diff --git a/lib/utils.js b/lib/utils.js
index 7395750d..d66eba3b 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -322,7 +322,9 @@ exports.parseQuery = function (qs) {
var key = pair.slice(0, i);
var val = pair.slice(++i);
+ // Due to how the URLSearchParams API treats spaces
obj[key] = decodeURIComponent(val.replace(/\+/g, '%20'));
+
return obj;
}, {});
};