GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Validates a URL before it is used in a fetch() call.

      • Relative URLs pass immediately (browser resolves to same origin).
      • Absolute URLs must use the http: or https: scheme.

      Parameters

      • url: string

        URL to validate.

      Returns void

      If the URL is empty, or if it is absolute with a non-http/https scheme.

      validateFetchUrl('https://tiles.openstreetmap.org/...');   // OK
      validateFetchUrl('../profiles/tourism/profile.json'); // OK (relative)
      validateFetchUrl('javascript:alert(1)'); // throws
      validateFetchUrl('file:///etc/passwd'); // throws
      validateFetchUrl('data:text/html,<h1>x</h1>'); // throws