File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ function parseQueryString(queryString) {
55 }
66
77 // Adds percentage-encoded characters
8- queryString = changePEC ( queryString ) ;
8+ queryString = decodeURIComponent ( queryString ) ;
99
1010 // Replaces + with space
1111 queryString = queryString . replaceAll ( "+" , " " ) ;
@@ -26,21 +26,4 @@ function parseQueryString(queryString) {
2626 return queryParams ;
2727}
2828
29- // this function below can have the object PEC expanded to include all percentage-encoded characters
30- // currently without adding this database, an unknown PEC could cause the code to get stuck in an infinite loop
31-
32- function changePEC ( string ) {
33- const PEC = { "%24" : "$" , "%2F" : "/" } ;
34- while ( string . includes ( "%" ) ) {
35- const index = string . indexOf ( "%" ) ;
36- const code = string . slice ( index , index + 3 ) ;
37- if ( PEC [ code ] ) {
38- string = string . replace ( code , PEC [ code ] ) ;
39- } else {
40- break ;
41- }
42- }
43- return string ;
44- }
45-
4629module . exports = parseQueryString ;
You can’t perform that action at this time.
0 commit comments