Skip to content

Allow more characters in header values #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

njsmith
Copy link
Member

@njsmith njsmith commented May 6, 2018

The RFC says we should reject any header value that contains control
characters. But apparently in the real world, you have to both accept
and produce these sometimes (e.g. Google Analytics cookies use them).

As a compromise, we now accept most control characters, but continue
to disallow NUL (\x00) and all whitespace (\t\n\r\f\v and space),
except that space and tab are allowed inside header values when
surrounded by non-whitespace characters.

Closes: gh-57, gh-58

The RFC says we should reject any header value that contains control
characters. But apparently in the real world, you have to both accept
and produce these sometimes (e.g. Google Analytics cookies use them).

As a compromise, we now accept most control characters, but continue
to disallow NUL (\x00) and all whitespace (\t\n\r\f\v and space),
except that space and tab are allowed inside header values when
surrounded by non-whitespace characters.

Closes: python-hypergh-57, python-hypergh-58
@njsmith njsmith force-pushed the allow-more-chars-in-header-values branch from aff879f to 4e72ec4 Compare May 6, 2018 00:15
@codecov-io
Copy link

codecov-io commented May 6, 2018

Codecov Report

Merging #68 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #68   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          20     20           
  Lines         905    905           
  Branches      175    175           
=====================================
  Hits          905    905
Impacted Files Coverage Δ
h11/tests/test_events.py 100% <ø> (ø) ⬆️
h11/tests/test_io.py 100% <ø> (ø) ⬆️
h11/tests/test_headers.py 100% <ø> (ø) ⬆️
h11/_abnf.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da8a994...4e72ec4. Read the comment docs.

@njsmith njsmith merged commit eec3423 into python-hyper:master May 6, 2018
@njsmith
Copy link
Member Author

njsmith commented May 6, 2018

@sigmavirus24 thanks!

@sigmavirus24
Copy link

You're welcome

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.

3 participants