-
Notifications
You must be signed in to change notification settings - Fork 19
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
Issue with requests with invalid HTTP method #83
Comments
On second thought, I'm going to try putting the session check in :pre-route like I should have and see if that fixes it. |
issue still exists even as pre-route |
I managed to fix this by putting :close on my (send-response) error response. |
Hey, thanks for reporting this in such detail, and sorry for the lag in response. I was out of town. If wookie is handling the condition incorrectly, then maybe the issue should remain open, although is it possible this is a fast-http bug? |
@orthecreedence I don't think this is a fast-http bug because wookie ends up sending a blank request object (i.e. the initial request object it recreates) as a response. The issue is that the chunking is triggered when the request handlers are being parsed which happens even before the pre-route. This is problematic because that would mean chunking is started before the server can even make sure the user has permission to upload. |
This was horrendous to debug!
I managed to destroy wookie's HTTP parsing: in my js, I had a for loop of XHR requests over and over that send error responses when trying to access a session that is either 1) nonexistent or 2) unavailable (locked)
At some point in this, the browser sends over an invalid HTTP request (i'm not entirely sure about this, it could be something else entirely) and wookie incorrectly handles the fast-http invalid-method condition. It's relevant that I'm using with-chunks :t
My traceback is:
The applicable code:
https://github.com/kennymalac/simple-content-host/blob/master/src/program/slave.lisp#L71
I might just use hutchentoot. I have tried debugging this for a few hours now. It sucks because I really like the with-chunking macro that wookie has, but this error is really bad. It's hard to reproduce as well, I'm just trying to send an error response JSON if I don't want to chunk the response request. At first I thought, maybe with-chunking HAS to be called even if I want to reject the request? But some of the errors get returned, it's only when stress testing it, that it breaks entirely it seems. This is the request that wookie is trying to pass into http-parse:
Here's the relevant method where it ends up trying to use a blank request object:
wookie/parser.lisp
Line 282 in 288d108
Here's the route expanded:
The text was updated successfully, but these errors were encountered: