You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2002/04/15 04:58:11 UTC
cvs commit: httpd-2.0/server vhost.c
jerenkrantz 02/04/14 19:58:11
Modified: server vhost.c
Log:
Allow empty Host: header arguments.
Previously, request that sent:
GET / HTTP/1.1
Host:
would get a 400. RFC 2616 specifically allows for a "blank" host field.
The read_request code properly handled this, but the fix_hostname in
vhost.c would cause the 400. Now, simply return in fix_hostname when
we see a blank hostname rather than erroring out.
PR: 7441
Revision Changes Path
1.73 +5 -0 httpd-2.0/server/vhost.c
Index: vhost.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/vhost.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- vhost.c 18 Mar 2002 01:43:17 -0000 1.72
+++ vhost.c 15 Apr 2002 02:58:11 -0000 1.73
@@ -745,6 +745,11 @@
apr_port_t port;
apr_status_t rv;
+ /* According to RFC 2616, Host header field CAN be blank. */
+ if (!*r->hostname) {
+ return;
+ }
+
rv = apr_parse_addr_port(&host, &scope_id, &port, r->hostname, r->pool);
if (rv != APR_SUCCESS || scope_id) {
goto bad;