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

Always use a single space after colon for HTTP 1 headers #287

Merged
merged 2 commits into from
Jan 1, 2021

Conversation

sagebind
Copy link
Owner

@sagebind sagebind commented Jan 1, 2021

Previously headers were sent with no whitespace before or after the colon (:). This is legal according to RFC 7230, section 3.2, but is somewhat unusual and can cause poorly-written servers to choke on parsing the request. Update the encoder to always add a single space after the colon to be in line with what most parsers should expect.

This has no effect on HTTP/2 or newer, since they use a binary format for headers.

Fixes #286.

Previously headers were sent with no whitespace before or after the colon (`:`). This is legal according to RFC 7230, section 3.2, but is somewhat unusual and can cause poorly-written servers to choke on parsing the request. Update the encoder to always add a single space after the colon to be in line with what most parsers should expect.

This has no effect on HTTP/2 or newer, since they use a binary format for headers.

Fixes #286.
@codecov
Copy link

codecov bot commented Jan 1, 2021

Codecov Report

Merging #287 (98246cc) into master (4b65185) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #287   +/-   ##
=======================================
  Coverage   72.79%   72.79%           
=======================================
  Files          51       51           
  Lines        2727     2727           
=======================================
  Hits         1985     1985           
  Misses        742      742           
Impacted Files Coverage Δ
src/parsing.rs 100.00% <100.00%> (ø)

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 4b65185...98246cc. Read the comment docs.

@sagebind sagebind merged commit 61dec2d into master Jan 1, 2021
@sagebind sagebind deleted the 286-ows-http1-headers branch January 1, 2021 18:41
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.

default user-agent header is malformed
1 participant