Skip to content

Commit 7fc4886

Browse files
author
russom
committed
Using a regular expression .replace(/\+/g, " ") the + sign is removed from the key and value.
1 parent b10058d commit 7fc4886

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Sprint-2/implement/querystring.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function parseQueryString(queryString) {
1010
continue;
1111
}
1212
const everything = pair.split("=");
13-
const key = decodeURIComponent(everything.shift());
14-
const value = decodeURIComponent(everything.join("="));
13+
const key = decodeURIComponent(everything.shift().replace(/\+/g, " "));
14+
const value = decodeURIComponent(everything.join("=").replace(/\+/g, " "));
1515
queryParams[key] = value;
1616
}
1717

0 commit comments

Comments
 (0)