Skip to content

Commit 50d1cd5

Browse files
committed
fix issues with logged urls in default handler
1. when using node-http-proxy the standard handler would log an undefined hostname 2. when using the passed protocol instead of the fallback the // in the urls would be missing
1 parent 3a95b43 commit 50d1cd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function time(start) {
2424
function defaultHandler(request, options, cb) {
2525
options = typeof options === 'string' ? urlParse(options) : options;
2626

27-
var url = options.href || (options.protocol || 'http://') + options.host + options.path;
27+
var url = options.href || (options.protocol || 'http:') + '//' + (options.host || options.hostname) + options.path;
2828
var method = (options.method || 'GET').toUpperCase();
2929
var signature = method + ' ' + url;
3030
var start = new Date();

0 commit comments

Comments
 (0)