ordspv
    Preparing search index...

    Function normalizeBaseUrl

    • Canonical form of a backend base URL, for comparing one endpoint to another.

      Header anchoring excludes the backends that served a bundle from the vote, and that exclusion is a set membership test. Host names are case-insensitive in DNS and HTTP, so two spellings that differ only in case address the same server; comparing raw strings let such a spelling pass as an independent attester and vote for the header it had just served. Scheme and host are lowercased, a single trailing dot on the host folds away (a root-anchored FQDN resolves to the same name), and trailing slashes go. The URL parser has already dropped a default port (:443 on https, :80 on http) by the time this code sees the parts; a non-default port stays, since it is a different endpoint. The path keeps its case, since path components are case-sensitive.

      This is canonicalization for comparison and not a general URL cleaner. Two hostnames belonging to one operator stay two entries, because no string function can know they are related. Operator diversity remains the caller's responsibility.

      Parameters

      • url: string

      Returns string