chesterpolo / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Header Parse of valid "*" Uri #125

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Send the following Header "GET * HTTP/1.1\r\n\r\n
2. Will be rejected with a 400

The rejection is caused around line 2827:
if( ....
    ri->uri[0] == '/' &&
    ...
)

ri->uri[0] == '*' which is valid but is rejected.

Possible fix would be to change the line to:
( ri->uri[0] == '/' || ( ri->uri[0] == '*' && ri->uri[1] == 0 ) ) &&

Original issue reported on code.google.com by drc...@earthlink.net on 5 Mar 2010 at 12:40

GoogleCodeExporter commented 9 years ago
I think HTTP standard allows for "*" in the request line.
Can you elaborate more on why do you think asterisk should be supported?

Original comment by valenok on 5 Mar 2010 at 9:25

GoogleCodeExporter commented 9 years ago
I would suggest that support for the standard (rfc2616 section 5.1.2) should be
enough cause, but if we need another. There are certain situation when a 
directory
path is not needed and is in fact meaningless when the use of ‘*’ is 
desirable. The
particular instance I am interested in is the use of the POST Method to send a 
binary
document to the server. One could hack around the issue by using the ‘/’ 
uri, but
that seems a bit silly since the change is should be trivial and brings the 
software
more fully into the standard.

See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2

Original comment by drc...@earthlink.net on 5 Mar 2010 at 5:06

GoogleCodeExporter commented 9 years ago

Original comment by valenok on 8 Mar 2010 at 9:48

GoogleCodeExporter commented 9 years ago
Submitted 
http://code.google.com/p/mongoose/source/detail?r=22dfc3ad3a5fa2aaf396de8f7eee62
0d05e75447
Thanks.

Original comment by valenok on 29 Nov 2010 at 5:28