-
Notifications
You must be signed in to change notification settings - Fork 263
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
Reworked header lines logic #968
base: master
Are you sure you want to change the base?
Conversation
Let's throw away the multiple line support to make the code simpler. |
If we do that, we'll just quickly split on any |
I think so. |
5092f23
to
479b9a2
Compare
This is rebased on top of After this we don't accept multiline headers anymore, so should we bump the major version? |
7f38acf
to
b017ce1
Compare
Hmmm, I'll probably have to rebase on master again for the formatting commits to be excluded from this PR 🤔 will do that later today, hopefully. |
I have done it already on my local branch. |
…upported anymore I checked the parsing of headers functions and we apparently do not throw or abort on any invalid header formats. Do we want to do that? Or do we defer that judgement to any user of 'warp'?
…oved 'BangPatterns'
b017ce1
to
40e51a2
Compare
So only two issues before we might merge this:
|
Probably yes.
#972 provides such an exception. We might want to integrate it into warp. |
I'll take a look at it. Hopefully this weekend. I do feel it's better to abort early, though we should keep the code fast for correct requests, if those are ever at odds. |
…w, and some more tweaks to improve performance
Added benchmarks and adjusted according to results. The number after the bench name is the amount of chunks the request is split into. In short:
In full:
|
Rebased, added PackIntSpec to the cabal and merged. I will release a new version of warp soon to support a new major version of |
Cool 👍 I'll be chipping away at this PR from time to time to hopefully improve the parsing of requests. |
Wait, why did you close this PR? |
My bad. |
Note to self:
|
Hmmm, all CI works, except for the nightly Windows, because of this:
|
Before submitting your PR, check that you've:
After submitting your PR:
Had a go at making the header lines parsing more efficient.
I want to get some feedback on this first, and I'll want to check the benchmarks as well to see if this doesn't make anything worse. (Maybe add some benchmarks too)
I'm also wondering if we want to support multiline functionality in headers, still? The RFC 7230 states it deprecates this functionality. This RFC is from almost 10 years ago. It would make the parsing a lot easier.