Origin validation for WebTransport CONNECT upgrades, matching
Phoenix.Socket.Transport.check_origin/5 semantics.
Supports:
false- disables origin checking (useful for non-browser tests or CLI clients)true- checks againstendpoint.config(:url)[:host]listof origin patterns (e.g.["https://example.com", "//*.example.com:8443"]):conn- compares origin scheme/host/port against the request:authority{module, function, args}MFA tuple invoked asapply(module, function, [origin_uri | args])
When opts[:check_origin] is nil or omitted, defaults to
endpoint.config(:check_origin) if endpoint defines config/1, or false.
Summary
Functions
Validates an Origin header binary against the resolved policy.
Resolves and validates the effective :check_origin policy.
Types
Functions
@spec check(binary() | nil, module(), keyword(), map()) :: :ok | {:error, 403, :origin_missing | {:origin_not_allowed, binary()}}
Validates an Origin header binary against the resolved policy.
Unlike HTTP/WebSocket where non-browser clients may omit Origin, WebTransport
rejects a missing Origin header with {:error, 403, :origin_missing} whenever
origin checking is enabled (policy != false).
Resolves and validates the effective :check_origin policy.