Skip to content

Preserve literal IPv6 origins during CORS configuration - #414

Open
jackwalkerlabs wants to merge 1 commit into
corydolphin:mainfrom
jackwalkerlabs:codex/literal-ipv6-origins
Open

jackwalkerlabs wants to merge 1 commit into
corydolphin:mainfrom
jackwalkerlabs:codex/literal-ipv6-origins

Conversation

@jackwalkerlabs

Copy link
Copy Markdown

An allowed origin such as http://[::1]:8000 is currently compiled as a regex because of its brackets, so requests from that exact origin receive no allow-origin header. Recognize complete IPv6 origins during origin resolution and retain literal matching. Explicit/compiled regex origins keep their existing behavior.

Fixes #396.

Validation: seven new cases fail on the base; all nine IPv6 cases pass after the change. make check passes (locked dependencies, mypy, deptry); make test passes with 107 passed and one existing skip. Ruff lint/format checks pass for changed files. Coverage includes extension/decorator use, case-insensitive matching, different-address/port rejection, regex compatibility, and requests without an Origin header.

AI disclosure: Implemented, reviewed, and tested by OpenAI Codex under the account owner’s authorization; no human code review is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does Flask-CORS fully support IPv6 origins?

1 participant