Skip to content

Commit

Permalink
fix: use regex to avoid falsely replacing ports starting with 80 (#124)
Browse files Browse the repository at this point in the history
azrikahar authored Sep 26, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent eb73900 commit e981e62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/module.js
Original file line number Diff line number Diff line change
@@ -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', '')
}

0 comments on commit e981e62

Please sign in to comment.