-
Notifications
You must be signed in to change notification settings - Fork 927
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
Allow some control characters in a request target #5845
Conversation
Motivation: RFC 3986 doesn't prohibit control characters in a request target as long as it's percent-encoded. However, `DefaultRequestTarget` doesn't allow any control characters except `\r` and `\n` in a query string. This is to reject potentially harmful paths such as `/foo\nbar` but it can be overly strict to some users. Modifications: - `DefaultRequestTarget` now allows the following control characters additionally: - TAB (0x09) - FS (0x1C) - GS (0x1D) - RS (0x1E) - US (0x1F) - However, other control characters will remain prohibited until there's a good reason to allow them. - Simplified `appendOneByte()` by introducing additional `BitSet`s of percent-encodable characters. Result: - A user can send and receive an HTTP request whose `:path` contains the following characters now: - TAB (0x09) - FS (0x1C) - GS (0x1D) - RS (0x1E) - US (0x1F)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🙇♂️🙇♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍
Motivation:
RFC 3986 doesn't prohibit control characters in a request target as long as it's percent-encoded. However,
DefaultRequestTarget
doesn't allow any control characters except\r
and\n
in a query string.This is to reject potentially harmful paths such as
/foo\nbar
but it can be overly strict to some users.Modifications:
DefaultRequestTarget
now allows the following control characters additionally:appendOneByte()
by introducing additionalBitSet
s of percent-encodable characters.Result:
:path
contains the following characters now: