Fix Curl's HTTP/2 headers to match Chrome's headers

* Change the default HTTP/2 settings sent by Curl to match the ones that
Chrome sends. They appear in the SETTINGS message in the beginning of
the HTTP/2 handshake, which can be seen only after decrypting the TLS
traffic.
* Change the order of the HTTP/2 pseudo-headers ":authority", ":scheme"
and ":path" in the HEADERS message. Curl sent them in a different order
than Chrome.
This commit is contained in:
lwthiker
2022-02-19 00:49:01 +02:00
parent 647c4f428c
commit 01b4a33c82
5 changed files with 104 additions and 1 deletions

8
curl-http2-c.patch Normal file
View File

@@ -0,0 +1,8 @@
--- curl-7.81.0-original/lib/multi.c 2022-01-03 18:36:46.000000000 +0200
+++ curl-7.81.0/lib/multi.c 2022-02-18 22:43:54.939227658 +0200
@@ -395,3 +395,4 @@
multi->maxconnects = -1;
- multi->max_concurrent_streams = 100;
+ /* curl-impersonate: Use 1000 concurrent streams like Chrome. */
+ multi->max_concurrent_streams = 1000;
multi->ipv6_works = Curl_ipv6works(NULL);