Bug #1555
closed1.5.0 r1992 rejects requests with segment request-method (1.4.x is fine)
Description
1.5.0 r1992 rejects requests where the request-method (eg. GET or POST) is not completely contained in the first TCP packet with 400 Bad Request.
"G","ET / HTTP/1.0\r\n\r\n" fails "GET", " / HTTP/1.0\r\n\r\n" fails "GET ","/ HTTP/1.0\r\n\r\n" works "GET / HTTP","/1.0\r\n\r\n" works "GET / HTTP/1.0", "\r\n\r\n" works
And of course,
"GET / HTTP/1.0\r\n\r\n" works
I can see why this optimisation might have been made, but it should only be an optimisation. It should not reject requests that do split the packet here as that violates HTTP.
1.4.x works fine here.
-- Evill
Files
Updated by Anonymous almost 17 years ago
Ignore the extra spaces after the commas, they have no significance. Should look like this:
"G","ET / HTTP/1.0\r\n\r\n" fails "GET"," / HTTP/1.0\r\n\r\n" fails "GET ","/ HTTP/1.0\r\n\r\n" works "GET / HTTP","/1.0\r\n\r\n" works "GET / HTTP/1.0","\r\n\r\n" works
-- Evill
Updated by Anonymous almost 17 years ago
Here's output from the test code:
'G','ET / HTTP/1.0\r\n\r\n' => HTTP/1.0 400 Bad Request 'GET',' / HTTP/1.0\r\n\r\n' => HTTP/1.0 400 Bad Request 'GET ','/ HTTP/1.0\r\n\r\n' => HTTP/1.0 200 OK 'GET / HT','TP/1.0\r\n\r\n' => HTTP/1.0 200 OK 'GET / HTTP','/1.0\r\n\r\n' => HTTP/1.0 200 OK 'GET / HTTP/1.0','\r\n\r\n' => HTTP/1.0 200 OK 'GET / HTTP/1.0\r\n\r\n','' => HTTP/1.0 200 OK
Test code was written very quickly, so use your intuition if something breaks. :)
-- Evill
Updated by stbuehler almost 17 years ago
The patch adds a comment in lempar.c as well - perhaps lempar.c should be "fixed" too, but i do not completely understand lemon/lempar till now, so i didn't touch that.
Updated by stbuehler over 16 years ago
- Status changed from New to Fixed
- Resolution set to fixed
Fixed in r2269
Also available in: Atom