]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
From: "Andres Kroonmaa" <andre@ml.ee>
authorwessels <>
Wed, 4 Dec 1996 00:00:11 +0000 (00:00 +0000)
committerwessels <>
Wed, 4 Dec 1996 00:00:11 +0000 (00:00 +0000)
    Beta25 has a POST (and possibly HEAD) method broken. Constitutes as
 never-ending post request to server. I had a registration form that got
 broken by this. I investigated it a little and found soon that squid was
 prepending some garbage before POST header.
    I don't know the code too well and can't say if it brakes anything
 other, but I believe this patch below is for good.
    Basically, before sending POST request to server, request buffer has
 some garbage in it, and httpAppendRequestHeader appends to it, although
 code keeps track of how much it has written there, so I made it overwrite
 what was there and was not tracked for.
    Looks small fix, but it took me all day to trace...

src/http.cc

index f6040183bcfb158f98785b13de3ba442fa7d480d..3ec6629574b255b4390178477c2e5e03817262d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.123 1996/12/02 05:55:08 wessels Exp $
+ * $Id: http.cc,v 1.124 1996/12/03 17:00:11 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -618,7 +618,7 @@ httpAppendRequestHeader(char *hdr, const char *line, size_t * sz, size_t max)
     if (n >= max)
        return;
     debug(11, 5, "httpAppendRequestHeader: %s\n", line);
-    strcat(hdr + (*sz), line);
+    strcpy(hdr + (*sz), line);
     strcat(hdr + (*sz), crlf);
     *sz = n;
 }