1
0
mirror of synced 2025-04-21 22:25:55 +03:00

442 Commits

Author SHA1 Message Date
Sung, Po Han
7196ac8a07 Fix incorrect handling of Expect: 100-continue
Fix #1808
2024-09-04 17:50:42 +08:00
yhirose
975cf0dae5 Fix #1908 2024-09-03 18:00:12 -04:00
yhirose
b1f8e986bf
Fix #1908 (#1910)
* Fix #1908

* Code format
2024-09-03 00:47:39 -04:00
yhirose
c5ee208775 Fix build error on Mac and Linux 2024-09-02 23:04:38 -04:00
yhirose
ddfdacfa49 Fix build error 2024-09-02 22:49:31 -04:00
yhirose
2514ebc20f Fix #1848 2024-09-02 20:38:01 -04:00
yhirose
88277139e7
Added set_ipv6_v6only method (#1905)
* Added `set_ipv6_v6only` method

* Adjust the place where socket_options is called
2024-09-01 07:52:24 -04:00
yhirose
9c91b6f4a6 Fix #1645 2024-09-01 00:11:07 -04:00
yhirose
da0c6579fa Breaking Change! get_header_ methods on Request and Response now take a default value. 2024-08-31 17:07:48 -04:00
Jiwoo Park
6c3e8482f7
Fix KeepAliveTest.SSLClientReconnectionPost (#1895) 2024-08-10 07:19:59 -04:00
yhirose
aa04feebb4 Fix warnings 2024-08-08 20:54:33 -04:00
yhirose
521529d24d
Fix #1481 (with content provider) (#1527)
* Fix #1481 (with content provider)

* Improve shutdown performance

* Make shutdown action more stable

* Move some tests up

* Simplified

* Simplified
2024-08-06 13:43:00 -04:00
yhirose
ed0719f2bc Code format 2024-08-06 07:20:05 -04:00
Hlado
8cd0ed0509
Added move assignment operator to Client class. (#1873) 2024-06-30 11:17:00 -04:00
Andrea Pappacoda
bdefdce1ae
test: fix GetRangeWithMaxLongLength on 32 bit machines (#1867)
The test used the hardcoded long value for 64 bit machines even on 32
bit ones, leading to test failures. With this patch the max long length
is obtained using std::numeric_limits<long>::max(). Thanks to q2a3z for
the hint!

Fixes: https://github.com/yhirose/cpp-httplib/issues/1795
2024-06-23 17:49:00 -04:00
Rainer Schielke
d44031615d
New function SSLServer::update_certs. Allows to update certificates while server is running (#1827)
* New function SSLServer::update_certs. Allows to update certificates while server is running

* New function SSLServer::update_certs. Added unit test

---------

Co-authored-by: CEU\schielke <Rainer.Schielke@heidelberg.com>
2024-06-03 09:37:40 -04:00
Sean Quinn
98cc1ec344
Allow hex for ip6 literal addr, fix #1800 (#1830)
* Allow hex for ip6 literal addr, fix #1800

* Add UT for ipv6 + Universal client implementation

* add /n at EOF
2024-05-26 08:57:07 -04:00
Jiwoo Park
3b6597bba9
Fix query parsing when value has = characters (#1822)
* Implement string divider to replace splitter

* Divide query string in half

* Add a test case for query values containing the '=' character

* Add test cases for string divider

* Fix warnings
2024-04-21 19:17:14 -04:00
rndm13
2bc550b2f0
Added progress to POST, PUT, PATCH and DELETE requests (#1821)
* Added progress to POST, PUT, PATCH, DELETE requests

* Added tests for post, put, patch, delete progress/cancellation

* fix accidental infinite recursion in delete

---------

Co-authored-by: rndm <rndm@localhost.localdomain>
2024-04-21 19:13:41 -04:00
Kent
560854a961
Apply range header base on response status code (#1806)
* Enable ignoring range header to generate customized response

* Apply range header base on response status code
2024-04-11 23:28:21 -04:00
Jiwoo Park
f44ab9b3da
Fix range parser when parsing too many ranges (#1812)
* Implement range parser without std::regex

* Add test cases for invalid ranges
2024-04-07 10:06:16 -04:00
yhirose
548dfff0ae Fix #1793 2024-03-09 22:26:17 -05:00
yhirose
9d6f5372a3 Fix #1772 2024-02-05 22:11:53 -05:00
yhirose
762024b890 Fix #1768 2024-02-02 23:17:32 -05:00
yhirose
e323374d2a Fix #1766 2024-01-28 17:43:51 -05:00
yhirose
fceada9ef4 Changed to return 416 for a request with an invalid range 2024-01-28 08:13:19 -05:00
yhirose
420c9759c6 Fix #1694 2024-01-27 16:13:54 -05:00
Wander Nauta
4ef9ed80cd
Treat paths with embedded NUL bytes as invalid (#1765)
Fixes #1763.
2024-01-27 08:22:00 -05:00
vmaffione
374d058de7
ThreadPool: optional limit for jobs queue (#1741)
For very busy servers, the internal jobs queue where accepted
sockets are enqueued can grow without limit.
This is a problem for two reasons:
 - queueing too much work causes the server to respond with huge latency,
   resulting in repetead timeouts on the clients; it is definitely
   better to reject the connection early, so that the client
   receives the backpressure signal as soon as the queue is
   becoming too large
 - the jobs list can eventually cause an out of memory condition
2023-12-24 08:20:22 -05:00
Ilya Andreev
5b943d9bb8
Use StatusCode in tests and examples (#1743)
* Use StatusCode in tests and examples

* Use StatusCode in README
2023-12-20 17:28:57 -05:00
yhirose
f1dec77f46 Code format 2023-12-17 22:00:33 -05:00
yhirose
cddaedaff8 Fix #1736 2023-12-15 19:29:54 -05:00
davidalo
e426a38c3e
Fix: Query parameter including query delimiter ('?') not being parsed properly (#1713)
* Fix: Query parameter including query delimiter ('?') not being parsed properly

* Add details::split function with and without m argument to allow split parameters with/without counter

* Revert changes in SplitTest.ParseQueryString
2023-12-07 14:28:41 -05:00
yhirose
c5c704cb3b Fix #1724 2023-12-04 21:34:55 -05:00
Jiwoo Park
f1431311a4
Minor fixes on test cases (#1709)
* Fix data race

* Replace sleep_for() to wait_until_ready()
2023-11-11 21:28:50 -05:00
yhirose
f63ba7d013 Fix #1685 2023-10-03 09:59:27 -04:00
PabloMK7
a609330e4c
Add optional user defined header writer (#1683)
* Add optional user defined header writer

* Fix errors and add test
2023-09-30 22:13:14 -04:00
Jiwoo Park
c029597a5a
Update the remote address of www.httpwatch.com (#1664) 2023-09-13 10:33:33 -04:00
yhirose
6650632e7f Fix #1638 2023-08-22 19:36:10 -04:00
yhirose
6bb580cda8 Fix #1559 2023-07-31 00:27:26 -04:00
yhirose
2e34a39673 Added StaticFileRanges test 2023-07-31 00:22:22 -04:00
yhirose
01b90829bc Removed unnecessary CRLF at the end of multipart ranges data 2023-07-31 00:22:22 -04:00
yhirose
ec87b04aff Fix #1619 2023-07-29 00:53:57 -04:00
yhirose
aabf752a51 Fix #1519 2023-07-28 23:37:45 -04:00
bdenhollander
ee625232a4
Fix successful decompress reported as Error::Read (#1612)
* Fix successful decompress reported as Error::Read

Streams less than 4096 bytes are sometimes reported as failed reads because stream_.avail_in is not reduced to 0. The next iteration of the loop finds `prev_avail_in == strm_.avail_in` and return false. `ret = inflate(...)` returns Z_STREAM_END on the first iteration of the loop indicating that inflate is finished. This fix prevents the second iteration of the loop from failing.

* Fix successful decompress reported as Error::Read

- Add unit tests for raw deflate that illustrates the decompression failure when there are extra trailing bytes
2023-07-11 18:35:27 -04:00
bgs99
17fc522b75
Add named path parameters parsing (Implements #1587) (#1608)
* Add named path parameters parsing

* Select match mode based on pattern

* Add examples and comments to README

* Add documentation to matchers
2023-07-05 07:44:19 -04:00
yhirose
f1daa5b88b Fix #1607 2023-07-04 20:27:11 -04:00
Jiwoo Park
4a61f68fa4
Don't overwrite the last redirected location (#1589)
* Don't overwrite the last redirected location

* Check the last redirected location
2023-06-16 14:56:16 -04:00
Jiwoo Park
067890133c
Use nghttp2-hosted httpbin.org (#1586)
* Use nghttp2-hosted httpbin.org

* Add CPPHTTPLIB_DEFAULT_HTTPBIN macro to choose the default httpbin.org
2023-06-15 11:12:41 -04:00
Jiwoo Park
eab5ea01d7
Load in-memory CA certificates (#1579)
* Load in-memory CA certs

* Add test cases for in-memory cert loading

* Don't use the IIFE style
2023-06-09 16:34:51 +09:00