@maschinenlesbar.org/dip-bundestag-cli
    Preparing search index...

    Function validateBaseUrl

    • Check a configured base URL (baseUrlProblem) and return it as WHATWG parses it (URL#href: the host lower-cased, a default port dropped, the path percent-encoded where WHATWG does it), without trailing slashes: requests go to the URL every check of it reads (the host, the cleartext warning, the credentials' origin), and a transport that reads the URL as text reaches the same host. Throws DipValidationError (Invalid baseUrl: ...): a bad base URL is a configuration error, not a transport failure (DipNetworkError is kept for the default transport's per-hop checks). Called by the RequestEngine constructor (so DipClient and obtainKey too) on the raw value, before any request.

      Parameters

      • raw: string

      Returns string