I've modified my codes.
How about this?
This patch file is attached.

diff --git a/lib/http.c b/lib/http.c
index b673296..a312c61 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1559,6 +1559,27 @@ CURLcode Curl_add_custom_headers(struct
connectdata *conn,
         }
       }
     }
+    ptr = strchr(headers->data, ';');
+    if(ptr) {
+
+      ptr++; /* pass the semicolon */
+      while(*ptr && ISSPACE(*ptr))
+        ptr++;
+
+      if(*ptr) {
+        /* this may be used for something else in the future */
+      }
+      else {
+        if (*(--ptr) == ';') {
+          /* send no-value custom header if terminated by semicolon */
+          *ptr = ':';
+          result = Curl_add_bufferf(req_buffer, "%s\r\n",
+                                             headers->data);
+          if(result)
+            return result;
+        }
+      }
+    }
     headers = headers->next;


2011/9/6 Dan Fandrich <d...@coneharvesters.com>:
> Since the second form doesn't really even make much sense to use to trigger
> header data removal, and since it could be used for something else in the
> future, my suggestion is to trigger header data removal only if the
> semicolon comes at the end of the string, i.e. the first form above.

Regards,
Thank you.

Attachment: no-value-header_2.patch
Description: Binary data

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to