Skip to content

Strip trailing whitespace when parsing header values. - #59

Closed
wtn wants to merge 1 commit into
socketry:mainfrom
wtn:te
Closed

wtn wants to merge 1 commit into
socketry:mainfrom
wtn:te

Conversation

@wtn

@wtn wtn commented Oct 13, 2026

Copy link
Copy Markdown

HEADER keeps trailing whitespace in field values, because FIELD_VALUE also matches spaces and tabs:

"Transfer-Encoding: chunked \r\n"

This is read as "chunked ", so the body is not decoded as chunked. This issue also applies to chunked trailers.

I suggest to require the value to end with a character other than space or tab. Empty values still parse as an empty string.

Types of Changes

  • Bug fix.

Contribution

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wtn
wtn marked this pull request as ready for review October 13, 2026 18:45
@wtn
wtn marked this pull request as draft October 13, 2026 18:46
@wtn

wtn commented Oct 13, 2026

Copy link
Copy Markdown
Author

Closing as duplicate of #52.

@wtn wtn closed this Oct 13, 2026
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.

1 participant