Skip to content

Commit 85ce195

Browse files
committed
HEAD: don't force-close after response-headers
A HEAD response has no body length and gets the headers like the corresponding GET would so it should not get closed after the response based on the same rules. This mistake caused connections that did HEAD to get closed too often without a valid reason. Bug: http://curl.haxx.se/bug/view.cgi?id=3542731 Reported by: Eelco Dolstra
1 parent 18f8b7e commit 85ce195

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/http.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2851,7 +2851,8 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
28512851

28522852
if((k->size == -1) && !k->chunk && !conn->bits.close &&
28532853
(conn->httpversion >= 11) &&
2854-
!(conn->handler->protocol & CURLPROTO_RTSP)) {
2854+
!(conn->handler->protocol & CURLPROTO_RTSP) &&
2855+
data->set.httpreq != HTTPREQ_HEAD) {
28552856
/* On HTTP 1.1, when connection is not to get closed, but no
28562857
Content-Length nor Content-Encoding chunked have been
28572858
received, according to RFC2616 section 4.4 point 5, we

0 commit comments

Comments
 (0)