From e39218bacccda09b4f4584a2d8ef6f69b24cac39 Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Tue, 7 Feb 2017 19:19:58 +0100 Subject: [PATCH] url: empty file URL should be parsed correctly An empty file URL `file:` should be parsed to `file:///` instead of `file://`. In the `kFile` state, the process was braked immediately when the ch is EOL, but it should work as `default` in the kFile state to adjust slashes. --- src/node_url.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node_url.cc b/src/node_url.cc index 473c68541f1a15..5027399e89dd71 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -1074,8 +1074,10 @@ namespace url { SET_HAVE_QUERY() url.query = base.query; } + break; } - break; + state = kPath; + continue; case '\\': case '/': state = kFileSlash;