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

Function assertValidHttpProtocolURL

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

Source from the content-addressed store, hash-verified

55}
56
57function assertValidHttpProtocolURL(url, config) {
58 if (typeof url === 'string') {
59 const normalizedURL = normalizeURLForProtocolCheck(url);
60 if (malformedHttpProtocol.test(normalizedURL)) {
61 throw new AxiosError(
62 `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`,
63 AxiosError.ERR_INVALID_URL,
64 config
65 );
66 }
67 }
68}
69
70/**
71 * 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