Project

General

Profile

Actions

Bug #1555

closed

1.5.0 r1992 rejects requests with segment request-method (1.4.x is fine)

Added by Anonymous almost 17 years ago. Updated over 16 years ago.

Status:
Fixed
Priority:
High
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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

web_test.c (2.16 KB) web_test.c Isolated test case -- Evill Anonymous, 2008-02-11 13:58
Fix-1555-HTTP-Request-Response-only-accept-complet.patch (4.5 KB) Fix-1555-HTTP-Request-Response-only-accept-complet.patch stbuehler, 2008-02-15 11:21
Actions #1

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

Actions #2

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

Actions #3

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.

Actions #4

Updated by stbuehler over 16 years ago

  • Status changed from New to Fixed
  • Resolution set to fixed

Fixed in r2269

Actions

Also available in: Atom