geoview-core - v2.3.0
    Preparing search index...

    Function validateAndPingUrlOGC

    • Validates a URL's syntax and tests whether the server is reachable, with OGC GetCapabilities fallback.

      Strategy:

      1. Calls pingUrl for basic HEAD + file probe validation.
      2. If HEAD returned 4xx/5xx (server alive but bare path fails), tries OGC GetCapabilities directly (WMS/WFS/WMTS) since CORS was fine.
      3. If HEAD returned CORS error, tries OGC GetCapabilities through the proxy.

      The function never throws — all failures are returned as part of the result object.

      Parameters

      • targetUrl: string

        The URL to validate and ping

      • configProxyUrl: string = CONFIG_PROXY_URL

        Proxy URL to use when necessary (defaults to CONFIG_PROXY_URL)

      • timeoutMs: undefined = undefined

        Optional request timeout in milliseconds (defaults to none)

      Returns Promise<PingResult>

      A promise that resolves with a result object containing isValid, isReachable, needsProxy, status, and optional error