]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
First problem: if a client sends a Host: header with a different case than
authordgaudet <dgaudet@unknown>
Sun, 20 Jul 1997 18:36:03 +0000 (18:36 +0000)
committerdgaudet <dgaudet@unknown>
Sun, 20 Jul 1997 18:36:03 +0000 (18:36 +0000)
"Host:", the proxy won't see it and it will end up with two Host: headers
with different capitalization.

Second problem: if the proxy connects to a HTTP/0.9 server, the
first line returned will be corrupt because len was tampered with.

Reviewed by: Marc Slemko, Dean Gaudet, Randy Terbush
Submitted by: Kenichi Hori <ken@d2.bs1.fc.nec.co.jp>
PR: 813, 814

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3@78698 13f79535-47bb-0310-9956-ffa450edef68

APACHE_1_2_X/src/modules/proxy/proxy_http.c

index 4ca9cabfbdd573d9f5f81382bbb9f6601b18f612..71d6a9de73a2eea4972348087b6be5a2dcfe7d5a 100644 (file)
@@ -260,7 +260,7 @@ proxy_http_handler(request_rec *r, struct cache_req *c, char *url,
     for (i=0; i < reqhdrs_arr->nelts; i++)
     {
        if (reqhdrs[i].key == NULL || reqhdrs[i].val == NULL
-         || !strcmp(reqhdrs[i].key, "Host"))   /* already sent if there */
+         || !strcasecmp(reqhdrs[i].key, "Host"))  /* already sent if there */
            continue;
        bvputs(f, reqhdrs[i].key, ": ", reqhdrs[i].val, "\015\012", NULL);
     }
@@ -331,9 +331,8 @@ proxy_http_handler(request_rec *r, struct cache_req *c, char *url,
  * one type
  */
     
-    len = resp_hdrs->nelts;
     hdr = (struct hdr_entry *)resp_hdrs->elts;
-    for (i=0; i < len; i++)
+    for (i=0; i < resp_hdrs->nelts; i++)
     {
        if (hdr[i].value[0] == '\0') continue;
        p = hdr[i].field;
@@ -371,8 +370,7 @@ proxy_http_handler(request_rec *r, struct cache_req *c, char *url,
            cache = proxy_cache_error(c);
 
 /* send headers */
-    len = resp_hdrs->nelts;
-    for (i=0; i < len; i++)
+    for (i=0; i < resp_hdrs->nelts; i++)
     {
        if (hdr[i].field == NULL || hdr[i].value == NULL ||
            hdr[i].value[0] == '\0') continue;