aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-07-31 21:30:19 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-07-31 21:30:19 +0000
commit1cf13c825fa9e45a3dc8f7abf5aa43d8446b89ab (patch)
tree239167b5543d5175139188021ad8060dce0c6120
parent9d5c6df788c8eaa3986aa78c27c896255f6dc1e9 (diff)
Replacing one of the internal headers with one that has no contents will now
completely disable that header to get sent.
-rw-r--r--lib/http.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/http.c b/lib/http.c
index c8be1e35d..f6b626606 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;
}