You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2015/02/11 04:12:30 UTC

[Bug 56718] Cleanup request Host headers when absolute URI are used

https://issues.apache.org/bugzilla/show_bug.cgi?id=56718

--- Comment #1 from Tom Francis <tf...@gmail.com> ---
Hi,

I discovered this bug myself recently, although my discovery of it was within
the wording of the newer RFC7230, Section 5.4 and related to mod_proxy - see
https://issues.apache.org/bugzilla/show_bug.cgi?id=57563

However I think that fixing this in core would be preferable as it fixes the
problem for more scenarios. In a way, you can consider the PHP or other
scripting back-end to be the 'true' origin server and that httpd passing
requests to PHP is acting as a proxy. If this viewpoint is taken, then httpd
MUST rewrite the Host: header to match the authority info of any request-target
that is in the absolute-form.

As well as trying to fix this in mod_proxy (See the patch in my linked bug
report), I also patched it in vhost.c, although I came up with a different
implementation to the original poster of this bug. My version, directly assigns
the authority component of a request-target that has the absolute-form, using
the parsed_uri struct that belongs to the request. I tasked myself to learn gdb
and step through the code to debug the behaviour (was fun!) and it seems to
work in all cases, including appending the port to the Host: header if it was a
part of the request-target.

Thanks,

Tom...

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org