aboutsummaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
authorRyan Petrello <lists@ryanpetrello.com>2011-05-20 00:50:35 -0400
committerisaacs <i@izs.me>2011-05-27 10:47:34 -0700
commit58a1d7ec30a5e26625f42c97c3cbe9134368605d (patch)
tree2dabdb93551bcf93674c700be4d4aef6f375551c /lib/url.js
parenteb4c9ed881cb93bc19401eb4270d113c4ba52d6b (diff)
downloadandroid-node-v8-58a1d7ec30a5e26625f42c97c3cbe9134368605d.tar.gz
android-node-v8-58a1d7ec30a5e26625f42c97c3cbe9134368605d.tar.bz2
android-node-v8-58a1d7ec30a5e26625f42c97c3cbe9134368605d.zip
Close #562 Close #1078 Parse file:// urls properly
The file:// protocol *always* has a hostname; it's frequently abbreviated as an empty string, which represents 'localhost' implicitly. According to RFC 1738 (http://tools.ietf.org/html/rfc1738): A file URL takes the form: file://<host>/<path> where <host> is the fully qualified domain name of the system on which the <path> is accessible... As a special case, <host> can be the string "localhost" or the empty string; this is interpreted as 'the machine from which the URL is being interpreted'.
Diffstat (limited to 'lib/url.js')
-rw-r--r--lib/url.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/url.js b/lib/url.js
index 21d3acb348..8b01c8548f 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -54,9 +54,7 @@ var protocolPattern = /^([a-z0-9]+:)/i,
// protocols that never have a hostname.
hostlessProtocol = {
'javascript': true,
- 'javascript:': true,
- 'file': true,
- 'file:': true
+ 'javascript:': true
},
// protocols that always have a path component.
pathedProtocol = {