yhirose
c795ad1c32
Fix #2259 . Add query string normalization to preserve parameter order in requests
2025-12-05 21:39:40 -05:00
yhirose
3e0fa33559
Implement ETag and Last-Modified support for static file responses and If-Range requests ( #2286 )
...
* Fix #2242 : Implement ETag and Last-Modified support for static file responses
* Add ETag and Last-Modified handling for If-Range requests
* Enhance HTTP date parsing with improved error handling and locale support
* Update httplib.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Update test/test.cc
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Update httplib.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Refactor ETag handling: separate strong and weak ETag checks for If-Range requests
* Fix type for mtime in FileStat and improve ETag handling comments
* Update httplib.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Resolved code review comments
* Update httplib.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Update httplib.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Refactor ETag handling: use 'auto' for type inference and improve code readability
* Refactor ETag handling: extract check_if_not_modified and check_if_range methods for improved readability and maintainability
* Code cleanup
* Update httplib.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Update test/test.cc
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Update httplib.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Update httplib.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Enhance ETag handling and validation in httplib.h and add comprehensive tests in test.cc
* Refactor ETag comparison logic and add test for If-None-Match with non-existent file
* Fix #2287
* Code cleanup
* Add tests for extreme date values and negative file modification time in ETag handling
* Update HTTP-date parsing comments to reference RFC 9110
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
2025-12-05 18:58:54 -05:00
yhirose
27b73f050e
Fix #2287
2025-12-05 08:50:12 -05:00
yhirose
dbd5ca4bf2
Add error handling for stream read timeouts and connection closures
2025-12-04 19:19:18 -05:00
yhirose
143019a38c
Fix #2284
2025-12-02 17:24:27 -05:00
yhirose
8bba34eebc
Add New Streaming API support ( #2281 )
2025-12-01 21:40:13 -05:00
Aaron Gokaslan
0a9102ff6b
Optimize ThreadPool and MatcherBase constructors ( #2283 )
...
Add a missing reserve and missing std::move to each ctor respectively. The latter should really be caught by a clang-tidy perf linter.
2025-11-30 21:49:23 -05:00
yhirose
adf58bf474
Release v0.28.0
2025-11-25 21:06:51 -05:00
yhirose
337fbb0793
Fix #2279
...
Enhance request handling: add support for requests without Content-Length or Transfer-Encoding headers
2025-11-25 20:30:43 -05:00
Copilot
9e7861b0b4
Add #undef _res after including resolv.h to prevent macro conflicts ( #2280 )
...
* Initial plan
* Add #undef _res after including resolv.h to prevent macro conflicts
Co-authored-by: yhirose <357397+yhirose@users.noreply.github.com >
* Complete task - added #undef _res after resolv.h include
Co-authored-by: yhirose <357397+yhirose@users.noreply.github.com >
* Remove accidentally committed codeql build artifacts
Co-authored-by: yhirose <357397+yhirose@users.noreply.github.com >
* Add inline comment explaining why #undef _res is necessary
Co-authored-by: yhirose <357397+yhirose@users.noreply.github.com >
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com >
Co-authored-by: yhirose <357397+yhirose@users.noreply.github.com >
2025-11-25 20:00:10 -05:00
Clarkok Zhang
27ee115a60
Fix android getaddrinfo issue ( #2273 )
...
Co-authored-by: Clarkok Zhang <clarkok8@gmail.com >
2025-11-14 16:48:21 -05:00
Clarkok Zhang
59882752aa
Add Client::Post with both content provider and receiver ( #2268 )
...
Co-authored-by: Clarkok Zhang <clarkok8@gmail.com >
2025-11-14 14:52:06 -05:00
chansikpark
4b2b851dbb
Fix HTTP 414 errors hanging until timeout ( #2260 )
...
* Fix HTTP 414 errors hanging until timeout
* All errors (status code 400+) close the connection
* 🧹
---------
Co-authored-by: Wor Ker <worker@factory>
2025-11-02 22:23:42 -05:00
yhirose
eacc1ca98e
Release v0.27.0
2025-10-27 19:57:53 -04:00
yhirose
ac9ebb0ee3
Merge commit from fork
...
* Fix "Untrusted HTTP Header Handling (REMOTE*/LOCAL*)"
* Fix "Untrusted HTTP Header Handling (X-Forwarded-For)"
* Fix security problems in docker/main.cc
2025-10-27 19:54:12 -04:00
yhirose
11eed05ce7
Fix #2255 and #2256
2025-10-27 19:51:55 -04:00
yhirose
2d8d524178
Fix #2251
2025-10-25 22:06:42 -04:00
yhirose
afa88dbe70
Fix #2250
2025-10-25 21:36:53 -04:00
yhirose
cde29362ef
Merge branch 'ssl_error_reporting' of github.com:staticlibs/cpp-httplib into staticlibs-ssl_error_reporting
2025-10-25 19:09:09 -04:00
yhirose
bae40fcdf2
Resolve #2237
2025-10-25 16:48:45 -04:00
Alex Kasko
23ff9a5605
Fix error reporting in SSLClient
...
When the `SSLClient` is used to connect to a plain-HTTP server (which
can happen in clients due to some end-user misconfiguration) it can
return a failure from the `send()` call without setting the `Error`
reference to the corresponding error code. This can cause problems to
callers, that may expect that, when the check like this is passed on
the response:
```c++
if (res.error() == Error::Success)
```
then they can access the response contents with `res.value()`. When
`SSLClient`'s connection fails - the contents `unique_ptr` is not set
and an attemt to access it causes UB.
This change fixes the `SSLClient::create_and_connect_socket` method
making sure that, the `Error` value is set correctly when the
`is_valid()` check fails.
2025-09-18 13:44:39 +01:00
yhirose
41be1e24e3
Code cleanup
2025-09-15 07:59:53 -04:00
Jonas van den Berg
6e52d0a057
Fix UB by use of dangling references in getaddrinfo_with_timeout ( #2232 )
...
* Fix use of dangling references
When the resolve thread is detached, local variables were still used, which could lead to a program crash.
* Add test to verify dangling ref fix
* Add missing brace initialization
* Assert that the remaining fields are really zeroed
* Fix use of chrono literals
2025-09-14 20:05:09 -04:00
yhirose
89c932f313
Release v0.26.0
2025-08-29 16:05:44 -04:00
yhirose
eb5a65e0df
Fix #2217
2025-08-29 15:01:59 -04:00
kgokalp
7a3b92bbd9
Fix: handle EAI_ALLDONE from gai_suspend in getaddrinfo_with_timeout ( #2228 )
2025-08-28 11:08:32 -04:00
yhirose
4285d33992
Fix #2223 ( #2224 )
...
* Fix #2223
* Fix build error
2025-08-26 21:42:13 -04:00
tejas
b8e21eac89
Initialize start time for server ( #2220 )
...
* Initialize start time for server
By initializing start_time_ for server, I hope to measure the time taken to process a request at the end maybe in the set_logger callback and print it.
I only see current usage in client with server retaining the inital min value
* Add test to verify start time is initialized
* Address review comments
* run clang format
2025-08-26 15:34:13 -04:00
Sergey
3fae5f1473
osx: fix inconsistent use of the macro TARGET_OS_OSX ( #2222 )
...
* osx: fix inconsistent use of the macro `TARGET_OS_OSX`
Fixed the build error on iOS:
```
httplib.h:3583:3: error: unknown type name 'CFStringRef'
870 | CFStringRef hostname_ref = CFStringCreateWithCString(
```
Note, `TARGET_OS_OSX` is defined but is 0 when `TARGET_OS_IOS` is 1,
and vise versa. Hence, `TARGET_OS_MAC` should have been used, that is
set to 1 for the both targets.
* improve: non-blocking getaddrinfo() for all mac target variants
`TARGET_OS_MAC` should have been used, that is set to 1 for all other
targets: OSX, IPHONE (IOS, TV, WATCH, VISION, BRIDGE), SIMULATOR,
DRIVERKIT.
2025-08-26 12:46:51 -04:00
Thomas Beutlich
dffce89514
#2201 Fix 32-bit MSVC compiler error due to unknown command #warning ( #2202 )
2025-08-12 17:06:09 -04:00
yhirose
3f44c80fd3
Release v0.25.0
2025-08-07 20:58:39 -04:00
yhirose
fbee136dca
Fix #2193 . Allow _WIN32
2025-08-06 23:12:33 -04:00
yhirose
b52d7d8411
ErrorLogger support ( #870 ) ( #2195 )
2025-08-06 17:38:18 -04:00
yhirose
0b3758ec36
Fix problem with Windows version check
2025-07-30 17:39:40 -04:00
yhirose
a5d4c143e5
Release v0.24.0
2025-07-29 19:47:48 -04:00
yhirose
c0c36f021d
Fix #2184 , #2185 ( #2190 )
...
* Fix #2184 , #2185
* Fix build error
* Update
* Update
2025-07-29 19:29:37 -04:00
yhirose
8e8a23e3d2
Fix #2187
2025-07-24 19:35:47 -04:00
yhirose
890a2dd85d
Fix #2189
2025-07-24 17:04:59 -04:00
yhirose
ca5fe354fb
Release v0.23.1
2025-07-16 17:59:52 -04:00
yhirose
1f110b54d8
Chang #error to #warning for the 32-bit environment check except 32-bit Windows
2025-07-11 22:44:29 -04:00
yhirose
7b6867bcdf
Fix #2021 ( #2180 )
2025-07-10 22:01:41 -04:00
yhirose
53ea9e8bb4
Fix #2111 ( #2179 )
2025-07-10 00:47:45 -04:00
yhirose
ecfd84c171
Release v0.23.0
2025-07-09 23:57:47 -04:00
yhirose
b5b2a1d1c8
Change uint64_t to size_t
2025-07-09 18:11:38 -04:00
yhirose
17ba303889
Merge commit from fork
...
* Fix HTTP Header Smuggling due to insecure trailers merge
* Improve performance
2025-07-09 07:10:09 -04:00
yhirose
802743264c
Remove incorrect comment
2025-07-08 23:53:52 -04:00
yhirose
9dbaed75ef
Fix #2175 ( #2177 )
...
* Fix #2175
* Update
2025-07-08 23:04:34 -04:00
yhirose
082acacd45
Merge commit from fork
...
* Fix Persistency of Unbounded Memory Allocation in Chunked/No-Length Requests Vulnerability
* Revert HTTP status code from 413 to 400
2025-07-08 17:11:13 -04:00
yhirose
52163ed982
Fix #2148 ( #2173 )
...
* Fix #2148
* Removed 32bit environment
* buld-error-check-on-32bit
* Use 32bit depedency from Windows
2025-07-07 21:30:08 -04:00
yhirose
af73377611
Fix #1578 ( #2171 )
...
* Fix #1578
* Update README
* Update
* Update
* Update
* Update
* Update
* Update
2025-07-06 21:27:24 -04:00