[Backport 7.x] Fix isHttpConnection check (#1528)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c520967790
commit
65fabb267d
4
index.js
4
index.js
@ -323,9 +323,9 @@ function getAuth (node) {
|
||||
|
||||
function isHttpConnection (node) {
|
||||
if (Array.isArray(node)) {
|
||||
return node.some((n) => new URL(n).protocol === 'http:')
|
||||
return node.some((n) => (typeof n === 'string' ? new URL(n).protocol : n.url.protocol) === 'http:')
|
||||
} else {
|
||||
return new URL(node).protocol === 'http:'
|
||||
return (typeof node === 'string' ? new URL(node).protocol : node.url.protocol) === 'http:'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user