Download Latest Version v0.46.0 source code.tar.gz (1.9 MB)
Email in envelope

Get an email when there's a new version of cpp-httplib

Home / v0.45.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-05-15 1.3 kB
v0.45.0 source code.tar.gz 2026-05-15 1.9 MB
v0.45.0 source code.zip 2026-05-15 2.1 MB
Totals: 3 Items   3.9 MB 7

What's Changed

Bug fixes

  • Fix crash on empty / comma-only X-Forwarded-For when set_trusted_proxies() is configured. get_client_ip() previously called front() on a vector that was empty whenever the header tokenized to zero segments ("", ",", ", , ,"); it now returns an empty string so process_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 like DELETE /items/1 with no Content-Length and no Transfer-Encoding would, on a persistent connection, let read_content consume 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-Length or 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() and detail::is_connection_persistent() helpers used by the keep-alive fix above (d755c43)
Source: README.md, updated 2026-05-15