summaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
authorShuan Wang <shuanwang@gmail.com>2013-07-17 13:10:09 -0700
committerisaacs <i@izs.me>2013-07-17 15:59:28 -0700
commit48a4600c5669bb2b624bf004bbbb88a2d97ff6f8 (patch)
treecae0ea1eaf67f25edaec3e618853197b258e7c79 /lib/url.js
parent04e0324f6a8a4bc39ec2e7488435d023626a6140 (diff)
downloadandroid-node-v8-48a4600c5669bb2b624bf004bbbb88a2d97ff6f8.tar.gz
android-node-v8-48a4600c5669bb2b624bf004bbbb88a2d97ff6f8.tar.bz2
android-node-v8-48a4600c5669bb2b624bf004bbbb88a2d97ff6f8.zip
url: Fix edge-case when protocol is non-lowercase
When using url.parse(), path and pathname usually return '/' when there is no path available. However when you have a protocol that contains non-lowercase letters and the input string does not have a trailing slash, both path and pathname will be undefined.
Diffstat (limited to 'lib/url.js')
-rw-r--r--lib/url.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/url.js b/lib/url.js
index bacf201dd6..09e9cceb42 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -318,7 +318,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
this.query = {};
}
if (rest) this.pathname = rest;
- if (slashedProtocol[proto] &&
+ if (slashedProtocol[lowerProto] &&
this.hostname && !this.pathname) {
this.pathname = '/';
}