MCPcopy Create free account
hub / github.com/axios/axios / assertValidHttpProtocolURL

Function assertValidHttpProtocolURL

lib/core/buildFullPath.js:45–56  ·  view source on GitHub ↗
(url, config)

Source from the content-addressed store, hash-verified

43}
44
45function assertValidHttpProtocolURL(url, config) {
46 if (typeof url === 'string') {
47 const normalizedURL = normalizeURLForProtocolCheck(url);
48 if (malformedHttpProtocol.test(normalizedURL)) {
49 throw new AxiosError(
50 `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`,
51 AxiosError.ERR_INVALID_URL,
52 config
53 );
54 }
55 }
56}
57
58/**
59 * Creates a new URL by combining the baseURL with the requestedURL,

Callers 1

buildFullPathFunction · 0.85

Calls 2

redactSensitiveURLPartsFunction · 0.85

Tested by

no test coverage detected