From 3a2ec1ad6cb4e13d269eb146d96fe2eebb50a9f1 Mon Sep 17 00:00:00 2001 From: ldm0 Date: Wed, 21 Oct 2026 22:34:57 +0800 Subject: [PATCH] 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. --- Cargo.lock | 1 - vendor/curl-sys-0.4.91/MOLI.md | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1a92cea0b92..24800b2ce13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", diff --git a/vendor/curl-sys-0.4.91/MOLI.md b/vendor/curl-sys-0.4.91/MOLI.md index e64aa587ad4..19cc2b59628 100644 --- a/vendor/curl-sys-0.4.91/MOLI.md +++ b/vendor/curl-sys-0.4.91/MOLI.md @@ -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.