Forum OpenACS Q&A: util_httppost and HOST header

Collapse
Posted by Kevin Murphy on
Should util_httppost send a "Host:" header field?  I don't know anything about HTTP, but from a quick Google, I notice that it is required in 1.1 and not even mentioned in the 1.0 protocol.  Even though util_httppost specifies the 1.0 protocol, I have very painfully found at least one server that returns a 403 (forbidden?) error if the Host field is not specified.  The server identifies itself as Netscape-Enterprise/4.0.  When I output a Host field in util_httppost, everybody's happy.

I debugged this by comparing the output of curl -d, Perl LWP POST, and util_httppost.

Also, it was very helpful to be able to insert "ns_log Notice whatever" messages in the openacs and aolserver TCL code (a big deal for me -- I didn't even know that a big part of the aolserver interface is written in TCL).

Now, back to that script that I said I would have done by tomorrow.  Thanks for the 3 hour detour, Netscape.  Only 3 or 4 more to go, hopefully.

-Kevin Murphy

Collapse
Posted by Tilmann Singer on
I think it should be included all the time. Lots of http 1.0 servers rely on the host header when they are doing virtual hosting.

If you add this to util_httppost make sure it also includes the port number.

Collapse
Posted by Jeff Davis on
I agree with Til.  You should file a bug in bug tracker...