Releases: yhirose/cpp-httplib
Releases · yhirose/cpp-httplib
v0.46.0
What's Changed
Security
- Fix proxy digest credential leak when an HTTPS origin returns
407inside a CONNECT tunnel. The 401/407 retry is now gated on the response actually coming from a proxy hop (#2457)
New features
v0.45.1
What's Changed
Bug fixes
- Fix iOS build break caused by
TARGET_OS_MACbeing true on all Apple platforms (iOS, tvOS, watchOS). The Keychain enumeration path andSecurity.hinclude guards are now narrowed toTARGET_OS_OSX, and definingCPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAINon a non-macOS Apple platform now emits an explicit#errordirecting users toset_ca_cert_path()with a bundled CA file. Addresses #2454 (#2455) - Fix zstd detection in the installed
httplibConfig.cmakeso downstream projects that depend on the installed package correctly pick up zstd (#2453)
Improvements
- Replace the deprecated
SecTrustCopyAnchorCertificates(deprecated in macOS 13) withSecTrustSettingsCopyCertificates, iterating over the System, Admin, and User trust domains to retain equivalent anchor-certificate coverage (#2455) - Declare
Server::stop()asnoexcept, reflecting that the implementation does not throw (#2451)
CI / Internal
- Add a best-effort BoringSSL CI job (Ubuntu and macOS) that builds BoringSSL from source and exercises cpp-httplib's existing OpenSSL backend path.
SSLClientServerTest.TlsVerifyHostnameis now backend-aware (BoringSSL is SAN-only per RFC 6125 §6.4.4), and the README notes BoringSSL as a best-effort variant with the C++14 and SAN-only caveats (#2456) - Add an iOS header parse check to CI to catch accidental use of macOS-only APIs or guards (e.g.
TARGET_OS_MACvsTARGET_OS_OSX) that would silently break iOS builds (#2455)
v0.45.0
What's Changed
Bug fixes
- Fix crash on empty / comma-only
X-Forwarded-Forwhenset_trusted_proxies()is configured.get_client_ip()previously calledfront()on a vector that was empty whenever the header tokenized to zero segments ("",",",", , ,"); it now returns an empty string soprocess_request()falls back to the connection-level remote address instead of crashing (5c92857) - Fix keep-alive corruption on requests without a framed body (#2450). The post-response drain ran for any request that
expect_content()accepted, so a method likeDELETE /items/1with noContent-Lengthand noTransfer-Encodingwould, on a persistent connection, letread_contentconsume bytes belonging to the next pipelined request — making the second request appear to vanish. The drain now only runs when the request actually has a framed body (Content-Lengthor chunked). The non-SSL "stray-bytes → 413" payload-limit check is likewise limited to non-persistent connections, since on keep-alive any pending bytes may be the next request rather than an unframed body (91271c0)
Internal
- Extract
detail::has_framed_body()anddetail::is_connection_persistent()helpers used by the keep-alive fix above (d755c43)
v0.44.0
What's Changed
Breaking change (behavioral)
- Stop percent-decoding HTTP request header values.
parse_header()previously applieddecode_path_component()to every header value (exceptLocation/Referer) afteris_field_value()validation, so wire sequences like%0D%0Apassed validation and expanded into literal CR/LF inside stored values — enabling response splitting, log injection, and proxy smuggling.%3D/%2C/%3Blikewise flippedCookieandX-Forwarded-Forboundaries against WAFs inspecting the wire form. RFC 9110 §5.5 specifies header values as opaque octets, so the auto-decode (and theLocation/Refererworkarounds for the same misbehavior) has been removed. Applications that need URI semantics on a header value should now calldecode_uri_component()ordecode_path_component()on the result explicitly. Fixes the long-standingReferer-with-%0Aissue (#2033) (fbb031e)
Bug fixes
- Make
ThreadPoolconstructor exception-safe on partial thread creation. Ifstd::threadconstruction throws partway through (e.g.pthread_createreturnsEAGAINunder thread-resource pressure), the partially-builtthreads_vector would destruct joinablestd::threadobjects and callstd::terminate(). The spawn loop now signals shutdown to the workers already created, joins them, and rethrows. Fix #2444 (#2445)
Tooling
scripts/release.shgains a--minorflag to force a minor bump even whenabidiffreports no ABI break, for behavioral breaking changes like the header-decoding fix above (e8e6528)
v0.43.4
What's Changed
Security / bug fixes
- Reject malformed chunk-size in chunked decoder:
strtoulsilently accepted a leading-and wrapped via
unsigned arithmetic, so chunk-size-2producedULONG_MAX-1, bypassing theULONG_MAXguard and letting
a client drive the server toward unbounded allocation. Replaced with a manual hex parser that requires at
least one hex digit, detectssize_toverflow per digit, and accepts only chunk-ext or end-of-line after
the digits (RFC 9112 §7.1) (87d62db) - Fix #2441: only invoke
setarchon Linux intest/Makefileso the test build works on FreeBSD and other
non-Linux systems wheresetarchis unavailable (a9bfe59)
CI / tests
- Use
vswhereto locate the Visual Studio install in the 32-bit Windows CI workflow, so it keeps working
aswindows-latestmigrates from VS 2022 to VS 2026 (#2442) - Guard
nullptr resin theKeepAliveTestproxy template so a transient upstream failure to
httpbingo.orgproduces a clean test failure instead of a SEGV under ASan (#2443)
Full Changelog: v0.43.3...v0.43.4
v0.43.3
What's Changed
Bug fixes
- Fix OSS-Fuzz #508342856: cap
Content-Lengthreservation bypayload_max_length_to prevent excessive memory allocation (2d2efe4) - Fix OSS-Fuzz #508087118: avoid stack overflow in
str2tag(92aecf8)
Fuzzing / tests
- Run all fuzzers via
make fuzz_test(cae7534) - Add OSS-Fuzz #508370122 reproducer to
client_fuzzercorpus (b223e29) - Make
fuzz_testrobust to missing corpus files (35c4026) - Drop
Str2tagTestunit test that broke split /-fno-exceptionsbuilds (f6524c0) - Document
str2tag_core's compile-time-only role (40e1846)
Full Changelog: v0.43.2...v0.43.3
v0.43.2
What's Changed
- Reproducer test for #2431 (getaddrinfo_a use-after-free) by @yhirose in #2433
- Fix #2431: drop getaddrinfo_a path (stack-use-after-free) by @yhirose in #2436
- Add client fuzzing harness by @DavidKorczynski in #2437
- Fix #2435: allow mmap to open files held open for writing by @yhirose in #2438
- Re-enable getaddrinfo_a with worker-completion wait (#2431) by @yhirose in #2439
Full Changelog: v0.43.1...v0.43.2
v0.43.1
Full Changelog: v0.43.0...v0.43.1
v0.43.0
v0.42.0
What's Changed
- test: WebSocketIntegrationTest.SocketSettings: do not set AF_INET by @jirislaby in #2420
New Contributors
- @jirislaby made their first contribution in #2420
Full Changelog: v0.41.0...v0.42.0