From 5b6d3291b5f26f70a0644b557d844253d9bdd265 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 14 Mar 2025 16:57:33 +0100 Subject: [PATCH] http: remove the space requirement after status-code It was introduced in 294136b75411893c5, but not shipped in a release. It has caused problems and after checking, the browsers don't insist on it even if RFC 9112 says it is mandatory. Adjust test 2 to do a response without the space. Closes #16728 --- lib/http.c | 6 +++--- tests/data/test2 | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/http.c b/lib/http.c index 3196b38936..5256ee7ead 100644 --- a/lib/http.c +++ b/lib/http.c @@ -3910,9 +3910,9 @@ static CURLcode http_rw_hd(struct Curl_easy *data, if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) { k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 + (p[2] - '0'); - p += 3; - if(ISBLANK(*p)) - fine_statusline = TRUE; + /* RFC 9112 requires a single space following the status code, + but the browsers don't so let's not insist */ + fine_statusline = TRUE; } } } diff --git a/tests/data/test2 b/tests/data/test2 index f9cef90a7d..adbceff097 100644 --- a/tests/data/test2 +++ b/tests/data/test2 @@ -9,8 +9,8 @@ HTTP Basic auth # # Server-side - -HTTP/1.1 200 OK + +HTTP/1.1 200 Date: Tue, 09 Nov 2010 14:49:00 GMT Server: test-server/fake swsclose Content-Type: text/html -- 2.47.2