category

# `http_origin_site_helpers`

Internal shared helpers for parsing HTTP origins and absolute URLs, deriving request endpoints, and comparing endpoints for schemeful same-site semantics.

Availability:
`logtalk_load(http_core(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-06-09
Compilation flags:
`static`
Extends:
`public` http_text_helpers
Uses:
atom
http_core
list
url(Representation)
Remarks:
(none)
Inherited public predicates:
(none)

## Public predicates

(no local declarations; see entity ancestors if any)

## Protected predicates

### `absolute_url_context/2`

Parses an absolute HTTP or HTTPS URL atom into a normalized endpoint and request path context.

Compilation flags:
`static`
Template:
`absolute_url_context(URL,Context)`
Mode and number of proofs:
`absolute_url_context(+atom,-compound)` - `zero_or_one`

### `origin_endpoint/2`

Parses an Origin header atom into a normalized HTTP or HTTPS endpoint.

Compilation flags:
`static`
Template:
`origin_endpoint(Origin,Endpoint)`
Mode and number of proofs:
`origin_endpoint(+atom,-compound)` - `zero_or_one`

### `request_endpoint/2`

Derives a normalized HTTP or HTTPS endpoint from normalized request properties.

Compilation flags:
`static`
Template:
`request_endpoint(Request,Endpoint)`
Mode and number of proofs:
`request_endpoint(+compound,-compound)` - `zero_or_one`

### `same_site/2`

Succeeds when two normalized endpoints or URL contexts are schemefully same-site using bundled public suffix rules, including exact, wildcard, and exception cases.

Compilation flags:
`static`
Template:
`same_site(Left,Right)`
Mode and number of proofs:
`same_site(+compound,+compound)` - `zero_or_one`

### `host_labels/2`

Splits a normalized host atom into non-empty dot-separated labels.

Compilation flags:
`static`
Template:
`host_labels(Host,Labels)`
Mode and number of proofs:
`host_labels(+atom,-list(atom))` - `zero_or_one`

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)