Skip to content
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

Normalize Content-Length into a single value if duplicated exactly #94

Conversation

StephenBrown2
Copy link
Contributor

Fixes #92

@codecov-io
Copy link

Codecov Report

Merging #94 into master will decrease coverage by 0.86%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage     100%   99.13%   -0.87%     
==========================================
  Files          20       20              
  Lines         927      929       +2     
  Branches      173      174       +1     
==========================================
- Hits          927      921       -6     
- Misses          0        7       +7     
- Partials        0        1       +1
Impacted Files Coverage Δ
h11/tests/test_headers.py 100% <ø> (ø) ⬆️
h11/_headers.py 100% <100%> (ø) ⬆️
h11/_writers.py 88.57% <0%> (-11.43%) ⬇️

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 68e32db...067ae24. Read the comment docs.

validate(_content_length_re, value, "bad Content-Length")
saw_content_length = True
if saw_content_length:
Copy link
Member

@sethmlarson sethmlarson Jan 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd also like to handle Content-Length: x, x, x, ... -> Content-Length: x @njsmith?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it also be if saw_content_length is not None, say if one header is Content-Length: 0?

@pgjones
Copy link
Member

pgjones commented Oct 4, 2020

I've followed this up with #109. Thoughts and comments desired there please.

@pgjones pgjones closed this Oct 4, 2020
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.

Handle multiple Content-Length headers with the same value
4 participants