MCPcopy Create free account
hub / github.com/nodejs/node / urlIsHttpHttpsScheme

Function urlIsHttpHttpsScheme

deps/undici/src/lib/web/fetch/util.js:1059–1065  ·  view source on GitHub ↗

* @see https://fetch.spec.whatwg.org/#http-scheme * @param {URL} url

(url)

Source from the content-addressed store, hash-verified

1057 * @param {URL} url
1058 */
1059function urlIsHttpHttpsScheme (url) {
1060 assert('protocol' in url) // ensure it's a url object
1061
1062 const protocol = url.protocol
1063
1064 return protocol === 'http:' || protocol === 'https:'
1065}
1066
1067/**
1068 * @typedef {Object} RangeHeaderValue

Callers 8

requestBadPortFunction · 0.70
finalizeAndReportTimingFunction · 0.70
mainFetchFunction · 0.70
processResponseEndOfBodyFunction · 0.70
httpRedirectFetchFunction · 0.70
addAllMethod · 0.50
putMethod · 0.50
#batchCacheOperationsMethod · 0.50

Calls 1

assertFunction · 0.50

Tested by

no test coverage detected