diff options
author | James M Snell <jasnell@gmail.com> | 2017-01-03 21:39:08 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-01-05 20:25:07 -0800 |
commit | 81228497c5edc7ebbde01c24851d06811699ef55 (patch) | |
tree | b32e95118745da34142515a8db5b023b2ef9bb76 /src | |
parent | 5161b00af5007a2c6f4fcf31d4d49bdd0600ed80 (diff) | |
download | android-node-v8-81228497c5edc7ebbde01c24851d06811699ef55.tar.gz android-node-v8-81228497c5edc7ebbde01c24851d06811699ef55.tar.bz2 android-node-v8-81228497c5edc7ebbde01c24851d06811699ef55.zip |
url: do not decode arbitrary %2e sequences in paths
Per a recent change to the URL spec, arbitrary %2e sequences
in URL paths that are not single or double dot segments are
not to be decoded.
Refs: https://github.com/whatwg/url/issues/87
Refs: https://github.com/whatwg/url/pull/156
Refs: https://github.com/w3c/web-platform-tests/commit/d93247d5cb7d70f80da8b154a171f4e3d50969f4
Fixes: https://github.com/nodejs/node/issues/10598
PR-URL: https://github.com/nodejs/node/pull/10602
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_url.cc | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/node_url.cc b/src/node_url.cc index 11a03ea521..538126eb87 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -1214,12 +1214,7 @@ namespace url { state = kFragment; } } else { - if (ch == '%' && p[1] == '2' && TO_LOWER(p[2]) == 'e') { - buffer += '.'; - p += 2; - } else { - AppendOrEscape(&buffer, ch, DefaultEncodeSet); - } + AppendOrEscape(&buffer, ch, DefaultEncodeSet); } break; case kCannotBeBase: |