From: Daniel Stenberg Date: Mon, 31 Jul 2000 21:30:19 +0000 (+0000) Subject: Replacing one of the internal headers with one that has no contents will now X-Git-Tag: curl-7_1_1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cf13c825fa9e45a3dc8f7abf5aa43d8446b89ab;p=thirdparty%2Fcurl.git Replacing one of the internal headers with one that has no contents will now completely disable that header to get sent. --- diff --git a/lib/http.c b/lib/http.c index c8be1e35d4..f6b6266062 100644 --- a/lib/http.c +++ b/lib/http.c @@ -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; }