h2/h3: handle methods with spaces

The parsing of the HTTP/1.1 formatted request into the h2/h3 header
structures should detect CURLOPT_CUSTOMREQUEST methods and forward them
correctly.

Add test_01_20 to verify

Fixes #19543
Reported-by: Omdahake on github
Closes #19563
This commit is contained in:
Stefan Eissing 2025-11-17 09:56:48 +01:00 committed by Daniel Stenberg
parent 2459dc7a22
commit ea105708c9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
8 changed files with 80 additions and 21 deletions

View file

@ -2248,7 +2248,10 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream,
if(result)
goto out;
rc = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, &result);
rc = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
!data->state.http_ignorecustom ?
data->set.str[STRING_CUSTOMREQUEST] : NULL,
0, &result);
if(!curlx_sztouz(rc, &nwritten))
goto out;
*pnwritten = nwritten;