Skip to content

Allow more characters in header values - #68

Merged
njsmith merged 1 commit into
python-hyper:masterfrom
njsmith:allow-more-chars-in-header-values
May 6, 2018
Merged

njsmith merged 1 commit into
python-hyper:masterfrom
njsmith:allow-more-chars-in-header-values

Conversation

@njsmith

@njsmith njsmith commented May 6, 2018

Copy link
Copy Markdown
Member

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

codecov-io commented May 6, 2018

Copy link
Copy Markdown

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

njsmith commented May 6, 2018

Copy link
Copy Markdown
Member Author

@sigmavirus24 thanks!

@sigmavirus24

Copy link
Copy Markdown

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