Skip to content

normalize newlines in forms to CRLF #53

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
merged 1 commit into from
Oct 17, 2024
Merged

Conversation

haarg
Copy link
Member

@haarg haarg commented Oct 17, 2024

HTTP::Message < 7.00 normalized newlines in requests to CRLF. This has been removed. Based on the HTML
spec
and URL spec, the CRLF normalization should be in the HTML layer. So the change in HTTP::Message is correct, and HTML::Form should be handling the normalization.

Add normalization of lone \r or \n into \r\n, as defined in the HTML spec.

Older HTTP::Message versions will do their own normalization. That will end up being a no-op, so we will still be compatible with those older versions.

HTTP::Message < 7.00 normalized newlines in requests to CRLF. This has
been removed. Based on the [HTML
spec](https://html.spec.whatwg.org/#converting-an-entry-list-to-a-list-of-name-value-pairs)
and [URL spec](https://url.spec.whatwg.org/#urlencoded-serializing), the CRLF
normalization should be in the HTML layer. So the change in
HTTP::Message is correct, and HTML::Form should be handling the
normalization.

Add normalization of lone \r or \n into \r\n, as defined in the HTML
spec.

Older HTTP::Message versions will do their own normalization. That
will end up being a no-op, so we will still be compatible with those
older versions.
@haarg haarg force-pushed the haarg/crlf-normalize branch from cd8038b to 63bf67a Compare October 17, 2024 15:28
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.68%. Comparing base (b86ca3f) to head (63bf67a).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
+ Coverage   85.66%   85.68%   +0.02%     
==========================================
  Files           9        9              
  Lines         544      545       +1     
  Branches      165      165              
==========================================
+ Hits          466      467       +1     
  Misses         38       38              
  Partials       40       40              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@oalders oalders left a comment

Choose a reason for hiding this comment

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

Thanks, @haarg!

@oalders oalders merged commit 90132a6 into master Oct 17, 2024
39 of 43 checks passed
@oalders oalders deleted the haarg/crlf-normalize branch October 17, 2024 18:49
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Apr 12, 2025
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