From 462fdc14732aae4b0b9c5334f37962d8c235caf9 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 15 Mar 2017 09:37:07 +0100 Subject: [PATCH] Restrict protocol around "file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As file URLs cannot have username/password/port we don’t want to allow changing the scheme of a URL that contains one or more of those components. Similarly a file URL can have an empty/null host, changing the scheme to another special URL that cannot have such a host would be bad. Fixes #259 and fixes #270. --- url.bs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/url.bs b/url.bs index ec35294e..6c566e1d 100644 --- a/url.bs +++ b/url.bs @@ -1495,6 +1495,12 @@ string input, optionally with a base URL base, opti
  • If url's scheme is not a special scheme and buffer is, then return. + +

  • If url includes credentials or has a non-null port, + and buffer is "file", then return. + +

  • If url's scheme is "file" and its + host is an empty host or null, then return.

  • Set url's scheme to buffer.