Provide a way to access the Request-URI sent in the HTTP request line #62

Closed
shaneaevans opened this Issue Oct 6, 2011 · 1 comment

3 participants

@shaneaevans

If the Request-URI in the HTTP request line is an absoluteURI, then the protocol, host & port are ignored when creating the mochiweb_request and there is no way to access these values later:
https://github.com/mochi/mochiweb/blob/v2.2.1/src/mochiweb.erl#L45

This is needed to correctly determine the resource identified by a request:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.2
and is essential to be able to implement a forward proxy.

@ysc7

Hi Shane42,

On the call to mochiweb_request:new_request you can pass specific headers.
Something like this:
[{"Host", "www.w3.org:80"} | Headers]

Please let me know if it would work in your case

@etrepum etrepum closed this Jul 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment