Hi,
I tried new wget from debian squeeze with apache proxy and I ended with error
message:
AH00569: client sent HTTP/1.1 request without hostname (see RFC2616 section
14.23): /
Apache source clearly says:
/*
* Client sent us an HTTP/1.1 or later request without telling us the
* hostname, either with a full URL or a Host: header. We therefore
* need to (as per the 1.1 spec) send an error. As a special case,
* HTTP/1.1 mentions twice (S9, S14.23) that a request MUST contain
* a Host: header, and the server MUST respond with 400 if it doesn't.
*/
Compare with wget source:
/* Examples in rfc2817 use the Host header in CONNECT
requests. I don't see how that gains anything, given
that the contents of Host would be exactly the same as
the contents of CONNECT. */
The answer is: you will gain compliance to RFC and compatibility.
Check attached patch please.
--
Pavel Mateja
diff --git a/src/http.c b/src/http.c
index fdb0d7e..17fd558 100644
--- a/src/http.c
+++ b/src/http.c
@@ -2022,10 +2022,9 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
the regular request below. */
proxyauth = NULL;
}
- /* Examples in rfc2817 use the Host header in CONNECT
- requests. I don't see how that gains anything, given
- that the contents of Host would be exactly the same as
- the contents of CONNECT. */
+ request_set_header (connreq, "Host",
+ aprintf ("%s:%d", u->host, u->port),
+ rel_value);
write_error = request_send (connreq, sock, 0);
request_free (connreq);