fix(fetch): retain native curl extensions with main header parsing

Port the upstream browser-response-headers feature, build adapter and C shim into the bundled libcurl. Keep the existing TLS EOF behavior and native connection timing while exposing the framing and header semantics required by main.
This commit is contained in:
ldm0
2026-11-22 02:02:04 +08:00
parent 992d7c28d2
commit 3a2ec1ad6c
2 changed files with 14 additions and 1 deletions
Generated
-1
View File
@@ -972,7 +972,6 @@ dependencies = [
[[package]]
name = "curl-sys"
version = "0.4.91+curl-8.23.0"
source = "git+https://github.com/lexmount/curl-rust?rev=0392e12475d8d1160d4cae07c172cac02797cc25#0392e12475d8d1160d4cae07c172cac02797cc25"
dependencies = [
"brotlic-sys",
"cc",
+14
View File
@@ -36,3 +36,17 @@ On upgrades, port `moli_timing.c`, the connection/transfer carriers and the
observation sites in `cf-socket.c`, `vtls.c`, `multi.c`, `progress.c` and
`getinfo.c`. Native regression coverage includes keep-alive reuse and close,
DNS provenance, concurrent HTTP/2 streams and proxy CONNECT/TLS ordering.
The `browser-response-headers` feature and its build-time `http_source` adapter
are copied from that revision. They normalize bare CR segments in HTTP/1
response headers before framing and header callbacks, retaining strict NUL and
conflicting framing checks. The adapter patches this vendored `http.c`, so the
TLS EOF and connection-timing extensions remain in the compiled source.
The same adapter and C shim must be kept in sync with the Rust curl wrapper.
Regression coverage includes `moli-fetch`'s bare-CR header and framing tests.
The HTTP build adapter and shim also retain the upstream EOF finalization for
unterminated plain-HTTP header blocks, including bare-CR fields and up to four
leading status-line CR bytes. HTTPS header truncation, NUL rejection, completed
body framing and deferred response publication remain enforced. Coverage lives
in `moli-fetch/src/tests/header_eof.rs`, including buffered, HTML and raw modes.