Skip to content

Commit 7ec9b70

Browse files
Use regex instead of startsWith which is unsupported in node 0.10
1 parent b309db0 commit 7ec9b70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function parse(str) {
4242

4343
// If the host is missing it might be a URL-encoded path to a socket.
4444
var pathname = result.pathname;
45-
if (!config.host && pathname && pathname.toLowerCase().startsWith('%2f')) {
45+
if (!config.host && pathname && /^%2f/i.test(pathname)) {
4646
var pathnameSplit = pathname.split('/');
4747
config.host = decodeURIComponent(pathnameSplit[0]);
4848
pathname = pathnameSplit.splice(1).join('/');

0 commit comments

Comments
 (0)