mirror of
https://github.com/curl/curl.git
synced 2026-07-26 10:17:17 +03:00
http: better error message for HTTP/1.x response without status line
If a response without a status line is received, and the connection is known to use HTTP/1.x (not HTTP/0.9), report the error "Invalid status line" instead of "Received HTTP/0.9 when not allowed". Closes #13045
This commit is contained in:
parent
a54d0bdc65
commit
df1fcb41e2
4 changed files with 134 additions and 0 deletions
|
|
@ -3410,6 +3410,10 @@ static CURLcode http_rw_headers(struct Curl_easy *data,
|
|||
/* this is not the beginning of a protocol first header line */
|
||||
k->header = FALSE;
|
||||
streamclose(conn, "bad HTTP: No end-of-message indicator");
|
||||
if(conn->httpversion >= 10) {
|
||||
failf(data, "Invalid status line");
|
||||
return CURLE_WEIRD_SERVER_REPLY;
|
||||
}
|
||||
if(!data->set.http09_allowed) {
|
||||
failf(data, "Received HTTP/0.9 when not allowed");
|
||||
return CURLE_UNSUPPORTED_PROTOCOL;
|
||||
|
|
@ -3443,6 +3447,10 @@ static CURLcode http_rw_headers(struct Curl_easy *data,
|
|||
if(st == STATUS_BAD) {
|
||||
streamclose(conn, "bad HTTP: No end-of-message indicator");
|
||||
/* this is not the beginning of a protocol first header line */
|
||||
if(conn->httpversion >= 10) {
|
||||
failf(data, "Invalid status line");
|
||||
return CURLE_WEIRD_SERVER_REPLY;
|
||||
}
|
||||
if(!data->set.http09_allowed) {
|
||||
failf(data, "Received HTTP/0.9 when not allowed");
|
||||
return CURLE_UNSUPPORTED_PROTOCOL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue