diff --git a/lib/http.c b/lib/http.c index 90f489d7a..6c7ee56b2 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2192,7 +2192,7 @@ CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn) } #endif - if(strcmp("Host:", ptr)) { + if(!strcasecompare("Host:", ptr)) { aptr->host = aprintf("Host:%s\r\n", &ptr[5]); if(!aptr->host) return CURLE_OUT_OF_MEMORY; diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 64859632a..d7fa78284 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -72,7 +72,7 @@ test417 test418 test419 test420 test421 test422 test423 test424 test425 \ test426 test427 test428 test429 test430 test431 test432 test433 test434 \ test435 test436 test437 test438 test439 test440 test441 test442 test443 \ test444 test445 test446 test447 test448 test449 test450 test451 test452 \ -test453 test454 test455 test456 test457 test458 test459 test460 \ +test453 test454 test455 test456 test457 test458 test459 test460 test461 \ \ test490 test491 test492 test493 test494 test495 test496 test497 test498 \ \ diff --git a/tests/data/test461 b/tests/data/test461 new file mode 100644 index 000000000..03d7c7a22 --- /dev/null +++ b/tests/data/test461 @@ -0,0 +1,48 @@ + + + +HTTP +HTTP GET +--header + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + +-foo- + + + +# +# Client-side + + +http + + +disable Host: when specified as lower case + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -H host: + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +User-Agent: curl/%VERSION +Accept: */* + + + +