Skip to content

Main content

Origin Port Equivalence Tool

Compare normalized HTTP(S) origin tuples including default-port normalization.

Loading tool…

Description

Compare normalized HTTP(S) origin tuples including default-port normalization.

Web protocol data has several layers: a complete message or URL, individual fields or components, and the literal tokens within them. Delimiter presence, spelling, comparison rules, and parser normalization can affect results. A check of one component needs its stated scope before it can be used in a larger parser or policy decision.

Compare normalized HTTP(S) origin tuples including default-port normalization.

When to use this tool

Use Origin Port Equivalence when you need one stated URL, header, or protocol-component check in a diagnostic or parser workflow. Supply the input level specified below.

How to use the tool and how it works

  1. Enter firstUrl, secondUrl. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read equivalent, firstOrigin, secondOrigin. Inspect equivalent before interpreting the associated values.

Parse firstUrl and secondUrl with the tool's URL parser, require HTTP or HTTPS for both, and compare their serialized origins exactly. Return equivalent and each parsed origin.1

Input fieldMeaning and unitsAccepted input
firstUrlFirst UrlRequired. Text; maximum UTF-16 length 8192.
secondUrlSecond UrlRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
equivalentEquivalentRequired. Boolean.
firstOriginFirst OriginRequired. Text; maximum UTF-16 length 8192.
secondOriginSecond OriginRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "firstUrl": "https://EXAMPLE.org:443/a",
    "secondUrl": "https://example.org/b"
  },
  "output": {
    "equivalent": true,
    "firstOrigin": "https://example.org",
    "secondOrigin": "https://example.org"
  }
}

Limitations and assumptions

  • Paths, queries, and fragments do not enter this origin comparison. Parser normalization includes default ports; origin equivalence does not establish common site, resource identity, trust, or CORS permission.
  • The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.

Alternative or Complementary methods

Use a complete URL or header parser when the task involves an entire field or message. Test actual browser, server, or cache behavior separately when a security or protocol decision depends on more than this component.

References

  1. Calculation and input contract: web/origin-port-equivalence — tool.io

Similar or alternative tools

  • web/url-origin

    An origin represents the scheme, host and effective port for supported URL schemes.

  • parse/url

    Split an absolute hierarchical URL into protocol, host, port, path, query, and fragment components. Bracketed IPv6 hosts and user-info prefixes are supported.