]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: remove the space requirement after status-code
authorDaniel Stenberg <daniel@haxx.se>
Fri, 14 Mar 2025 15:57:33 +0000 (16:57 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 14 Mar 2025 16:59:05 +0000 (17:59 +0100)
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
tests/data/test2

index 3196b38936ad366a2c5f853edc7ab4cd63c26d82..5256ee7ead238b78e91f6a476b231ff7896f902e 100644 (file)
@@ -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;
               }
             }
           }
index f9cef90a7dc9bda7c0aab219c6aff0f2359be254..adbceff097e8d9561b7e634df486224133d82d99 100644 (file)
@@ -9,8 +9,8 @@ HTTP Basic auth
 #
 # Server-side
 <reply>
-<data>
-HTTP/1.1 200 OK
+<data crlf="yes">
+HTTP/1.1 200
 Date: Tue, 09 Nov 2010 14:49:00 GMT
 Server: test-server/fake swsclose
 Content-Type: text/html