Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Bug in handling CONNECT requests #6

Closed
ptlomholt opened this issue May 17, 2010 · 3 comments
Closed

Bug in handling CONNECT requests #6

ptlomholt opened this issue May 17, 2010 · 3 comments

Comments

@ptlomholt
Copy link

There appears to be a bug in handling http CONNECT requests. In a CONNECT request, the uri that follows is of the form hostname:port, but the parser assumes if the first character is not '/', that the uri contains a 'full' uri, including schema, which is not the case for such requests. As a result, parsing fails for such requests.

@ry
Copy link
Contributor

ry commented May 17, 2010

Can you please provide a dump of such a request?

@ptlomholt
Copy link
Author

A sample request from http://muffin.doit.org/docs/rfc/tunneling_ssl.html:

CONNECT home.netscape.com:443 HTTP/1.0
User-agent: Mozilla/1.1N
Proxy-authorization: basic aGVsbG86d29ybGQ=

I can get a dump, but from the sample it is pretty obvious what the problem is...

The parser fails when it encounters the first period in the hostname as it assumes it is parsing the schema, not the hostname!
I guess an easy fix would be to skip directly to s_req_host state instead of s_req_schema iff the request is a CONNECT...

@ry
Copy link
Contributor

ry commented Jun 6, 2010

Fixed in 4cf39fd.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants