Build-tool normalization of a connect origin per the NAP's conformance vectors: lowercases scheme and host, converts IDN to Punycode, and rejects default ports, wildcards, paths, queries, fragments, and trailing slashes.
connect
Author-supplied origin.
The normalized origin or a rejection reason.
normalizeConnectOrigin('HTTPS://api.example.com'); // { ok: true, origin: 'https://api.example.com' }normalizeConnectOrigin('https://foo.com/'); // { ok: false, reason: 'trailing slash' } Copy
normalizeConnectOrigin('HTTPS://api.example.com'); // { ok: true, origin: 'https://api.example.com' }normalizeConnectOrigin('https://foo.com/'); // { ok: false, reason: 'trailing slash' }
Build-tool normalization of a
connectorigin per the NAP's conformance vectors: lowercases scheme and host, converts IDN to Punycode, and rejects default ports, wildcards, paths, queries, fragments, and trailing slashes.