Validates a URL before it is used in a fetch() call.
http:
https:
URL to validate.
If the URL is empty, or if it is absolute with a non-http/https scheme.
validateFetchUrl('https://tiles.openstreetmap.org/...'); // OKvalidateFetchUrl('../profiles/tourism/profile.json'); // OK (relative)validateFetchUrl('javascript:alert(1)'); // throwsvalidateFetchUrl('file:///etc/passwd'); // throwsvalidateFetchUrl('data:text/html,<h1>x</h1>'); // throws Copy
validateFetchUrl('https://tiles.openstreetmap.org/...'); // OKvalidateFetchUrl('../profiles/tourism/profile.json'); // OK (relative)validateFetchUrl('javascript:alert(1)'); // throwsvalidateFetchUrl('file:///etc/passwd'); // throwsvalidateFetchUrl('data:text/html,<h1>x</h1>'); // throws
Validates a URL before it is used in a fetch() call.
http:orhttps:scheme.