Hello

[email protected]:
curl -v -k -X POST -H 'X-Custom;' http://to/

the header terminated by semicolon.

If you would use this spec then its patch is below.
How about this?

Regards,
Yukihiro KAWADA


===
diff --git a/lib/http.cb/lib/http.c
index edf3e16..d72d4fd 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1522,6 +1522,7 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
{
char *ptr;
struct curl_slist *headers=conn->data->set.headers;
+ CURLcode result;

while(headers) {
ptr = strchr(headers->data, ':');
@@ -1555,7 +1556,20 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
checkprefix("Connection", headers->data))
;
else {
- CURLcode result = Curl_add_bufferf(req_buffer, "%s\r\n",
+ result = Curl_add_bufferf(req_buffer, "%s\r\n",
+ headers->data);
+ if(result)
+ return result;
+ }
+ }
+ }
+ else {
+ ptr = strchr(headers->data, ';');
+ /* send non-value custom header if terminated by semicolon */
+ if (ptr) {
+ if(*(ptr + 1) == '\0') {
+ *ptr = ':';
+ result = Curl_add_bufferf(req_buffer, "%s\r\n",
headers->data);
if(result)
return result;
===
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to