From 50be6863810501d61d32fa407d6a0e59054caf98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Pablo=20Ferna=CC=81ndez?= Date: Sun, 20 Sep 2015 12:15:39 +0100 Subject: [PATCH] Consider null protocol as missing protocol, not an unsupported one. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the URL is just a relative path, as in /blah/bleh, at least in v0.12.7, url.protocol is not set at all, thus, it’s null. --- lib/XMLHttpRequest.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/XMLHttpRequest.js b/lib/XMLHttpRequest.js index 949fdf9..2fdbb28 100644 --- a/lib/XMLHttpRequest.js +++ b/lib/XMLHttpRequest.js @@ -284,6 +284,7 @@ exports.XMLHttpRequest = function() { break; case undefined: + case null: case "": host = "localhost"; break;