From 5f3e2d20f6c7abd34f91e1981ac7eeae72ddfbe0 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 3 Jan 2017 12:54:33 -0500 Subject: [PATCH] Spec update: stop decoding all %2es in paths This follows https://github.com/whatwg/url/pull/156. --- README.md | 2 +- scripts/get-latest-platform-tests.js | 2 +- src/url-state-machine.js | 9 +-------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1b1ca8f..ff132e0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spe ## Current Status -whatwg-url is currently up to date with the URL spec up to commit [5e0b05](https://github.com/whatwg/url/tree/5e0b05e95a81fdd539c7b1bf97e69b3df701384f). +whatwg-url is currently up to date with the URL spec up to commit [fbff68](https://github.com/whatwg/url/tree/fbff6834a8a03576261f777d0e0afea5c1bc5a09). ## API diff --git a/scripts/get-latest-platform-tests.js b/scripts/get-latest-platform-tests.js index c4ee77b..800be74 100644 --- a/scripts/get-latest-platform-tests.js +++ b/scripts/get-latest-platform-tests.js @@ -15,7 +15,7 @@ const request = require("request"); // 1. Go to https://github.com/w3c/web-platform-tests/tree/master/url // 2. Press "y" on your keyboard to get a permalink // 3. Copy the commit hash -const commitHash = "e0012406859014e8f31dbaf12122d0cd10249db4"; +const commitHash = "d93247d5cb7d70f80da8b154a171f4e3d50969f4"; const sourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/urltestdata.json`; const setterSourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/setters_tests.json`; diff --git a/src/url-state-machine.js b/src/url-state-machine.js index 26ead83..1998803 100644 --- a/src/url-state-machine.js +++ b/src/url-state-machine.js @@ -976,14 +976,7 @@ URLStateMachine.prototype["parse path"] = function parsePath(c) { this.parseError = true; } - if (c === p("%") && - this.input[this.pointer + 1] === p("2") && - (this.input[this.pointer + 2] === p("e") || this.input[this.pointer + 2] === p("E"))) { - this.buffer += "."; - this.pointer += 2; - } else { - this.buffer += encodeChar(c, isDefaultEncode); - } + this.buffer += encodeChar(c, isDefaultEncode); } return true;