Skip to content

fix(header): reject values with bytes > 127u8 - #859

Open
RyanSquared wants to merge 1 commit into
hyperium:masterfrom
RyanSquared:master
Open

fix(header): reject values with bytes > 127u8#859
RyanSquared wants to merge 1 commit into
hyperium:masterfrom
RyanSquared:master

Conversation

@RyanSquared

Copy link
Copy Markdown

The documentation currently states:

If the argument contains invalid header value characters, an error is returned. Only visible ASCII characters (32-127) are permitted. Use from_bytes to create a HeaderValue that includes opaque octets (128-255).

This change limits the upper bound on bytes to 127, making use of RangeInclusive, stable since Rust 1.35.0.

It also allows the tab char (as RFC conformant linear white space). The docs should be amended to mention this as well. I considered it out of scope for this PR.

@seanmonstar

Copy link
Copy Markdown
Member

Thanks for the PR! I see what you mean. However, the change you suggested affects other constructors too in a way that it shouldn't. Because it's clearly confusing internally, I filed #860 to clear things up.

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