From e981e622891a347ad0ba651bf7c48db29a989f84 Mon Sep 17 00:00:00 2001 From: Azri Kahar <42867097+azrikahar@users.noreply.github.com> Date: Sat, 26 Sep 2020 18:51:46 +0800 Subject: [PATCH] fix: use regex to avoid falsely replacing ports starting with 80 (#124) --- lib/module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/module.js b/lib/module.js index 96a6ea4..e1f548b 100755 --- a/lib/module.js +++ b/lib/module.js @@ -115,7 +115,7 @@ function httpModule (_moduleOptions) { } // Remove port 80 when http - if (options.baseURL.includes('http://')) { + if (/^http:\/\/.*:80(\/|$)/.test(options.baseURL)) { options.baseURL = options.baseURL.replace(':80', '') }