Skip to content

Header name can't have OWS before semicolon#1147

Closed
joanhey wants to merge 4 commits intowalkor:masterfrom
joanhey:header-name-noOWS
Closed

Header name can't have OWS before semicolon#1147
joanhey wants to merge 4 commits intowalkor:masterfrom
joanhey:header-name-noOWS

Conversation

@joanhey
Copy link
Copy Markdown
Contributor

@joanhey joanhey commented Apr 3, 2026

No whitespace is allowed between the field name and colon.

https://www.rfc-editor.org/rfc/rfc9112#section-5

We need to add more tests, and another regex to validate it for all header names.

@joanhey joanhey marked this pull request as draft April 3, 2026 22:23
@walkor
Copy link
Copy Markdown
Owner

walkor commented Apr 8, 2026

Thanks
The latest code has already implemented the relevant checks, so this needs to be closed.

if (!isset($parts[1]) || !preg_match('/^[a-zA-Z0-9!#$%&\'*+\-.^_`|~]+$/', $parts[0])) {

@walkor walkor closed this Apr 8, 2026
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.

2 participants