Fix issues with bogus % encoded sequences in URLs
Add a URI sanitizer to the rack stack avoid rack throwing exceptions on the server side, and ignore errors decoding components on the client side. Fixes #1101
This commit is contained in:
parent
d218d5bf7d
commit
e20bb507f1
4 changed files with 25 additions and 11 deletions
|
@ -53,7 +53,12 @@ OSM = {
|
|||
j = pair.indexOf('='),
|
||||
key = pair.slice(0, j),
|
||||
val = pair.slice(++j);
|
||||
params[key] = decodeURIComponent(val);
|
||||
|
||||
try {
|
||||
params[key] = decodeURIComponent(val);
|
||||
} catch (e) {
|
||||
// Ignore parse exceptions
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue