From 34b58ebc6435796ec5e2174dd05c279f57d9718b Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 28 Apr 2022 12:35:31 +0100 Subject: [PATCH] fix(utils): request without hostname (#9649) --- lib/utils/request-wrapper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/request-wrapper.js b/lib/utils/request-wrapper.js index 38f20322da..962378964b 100644 --- a/lib/utils/request-wrapper.js +++ b/lib/utils/request-wrapper.js @@ -125,7 +125,7 @@ const httpWrap = (func) => { requestWrapper(url.toString(), request); } else { const req = url; - requestWrapper(req.url || req.href || `${req.protocol}//${req.hostname}${req.path}`, req); + requestWrapper(req.url || req.href || `${req.protocol}//${req.hostname || req.host}${req.path}`, req); } } else { requestWrapper(url, request);