Re: BUG: bad parse of full URL in request?
Alvaro Lopez Ortega <alvaro <at> sun.com>
2006-05-04 09:57:17 GMT
Hi,
> This is my first mail to cherokee mailing lists, so I hope I send it
> to the correct one.
Welcome Diego ;)
> I've been browsing source code from svn repository and a I've seen
> something strange (at least strange for me). In file header.c,
> function parse_request_first_line (lines 443 - 458) it checks if the
> resource requested is a full URL, and if it is, it looks for a '/'
> for getting the path of the resource in the server. But what if we
> do:
>
> $ telnet www.alobbs.com 80
> GET http://www.alobbs.com HTTP/1.1
> Host: www.alobbs.com
>
> HTTP/1.1 400 Bad Request
> ...
This is a known unsupported corner case. Let me explain the reasons:
- In first place, almost all the request that a Web Server receives
don't include the URI in the request, something like this:
GET / HTTP/1.1
Host: www.alobbs.com
so, there is no need of parsing the URL, simple because the
request and the Host header entry let the server know everything
it needs. I guess 99% of the request a common server receives are
not using full URLs as request.
- It only happen when the request doesn't request any object.
I would be happy to improve the support of this corner case, but it
would need some quite big changes in the header.c code, and probably
it would slow down a little bit the current code, so I think it
doesn't worth supporting the case.
Anyway, it someone finds out a way in which we can support it with
messing up the code or slowing down the header parsing I'll more
than happy to apply the patch.
> Of course, I can be wrong, I'm only a student with few knowledge
> about web servers. If so, I'm sorry. I'm sorry about my poor
> english too.
You were right Diego. There is an explanation for the issue though.
> Ouch!! I almost forget that: Cherokee version: "Server:
> Cherokee/0.5.3 (UNIX)" And I think the same problem appears in svn
> version.
The SVN trunk version is currently upside down. I have been working
in some HUGE changes for Cherokee 0.6, so we will need to start
working with pre-releases within a month or two in order to
stabilize all the new code
--
--
Greetings, alo.