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
Detect urlencoded form data header via regex #1314
Conversation
I can think of a couple ways to break this:
Not sure how much we care about this, but you could fix it by using |
Yeah, I though about that as well, I can easily switch to the same check used in the code self.getHeader('content-type').slice(0, 'application/x-www-form-urlencoded'.length) ===
'application/x-www-form-urlencoded' |
👍 |
This should be more strict: !/^application\/x-www-form-urlencoded(;|$)/.test(...)
|
Even this !/^application\/x-www-form-urlencoded(?:;|$)/.test(...) slight performance increase :) Btw is it valid to have an empty space between the |
rfc7231:
Oops... my bad. It can have any combination of spaces and tabs there. @nylen is right, it's easier to use |
Btw, I pushed the fixed regex yesterday, no idea if notification was sent about it. |
Detect urlencoded form data header via regex
Thanks! |
Fixes #1313 related to #1310