]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Replacing one of the internal headers with one that has no contents will now
authorDaniel Stenberg <daniel@haxx.se>
Mon, 31 Jul 2000 21:30:19 +0000 (21:30 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 31 Jul 2000 21:30:19 +0000 (21:30 +0000)
completely disable that header to get sent.

lib/http.c

index c8be1e35d474f298a90d29c72331482535f6d201..f6b6266062e9a19e27b14bbc02f2218cd494c980 100644 (file)
@@ -399,9 +399,22 @@ CURLcode http(struct connectdata *conn)
     }
 
     while(headers) {
-      sendf(data->firstsocket, data,
-            "%s\015\012",
-            headers->data);
+      char *ptr = strchr(headers->data, ':');
+      if(ptr) {
+        /* we require a colon for this to be a true header */
+
+        ptr++; /* pass the colon */
+        while(*ptr && isspace(*ptr))
+          ptr++;
+
+        if(*ptr) {
+          /* only send this if the contents was non-blank */
+
+          sendf(data->firstsocket, data,
+                "%s\015\012",
+                headers->data);
+        }
+      }
       headers = headers->next;
     }