1
0
mirror of synced 2025-06-12 07:41:53 +03:00
Commit Graph

395 Commits

Author SHA1 Message Date
d0b123be26 Support remote_addr and remote_port REMOTE_PORT header in client Request (#433) 2020-04-23 22:12:12 -04:00
df138366e4 Fail to read a chunk if its length is >= ULONG_MAX (#444)
We cannot trivially support such large chunks, and the maximum value
std::strtoul can parse accurately is ULONG_MAX-1. Error out early if the
length is longer than that.
2020-04-23 10:59:15 -04:00
c49441ae64 Do not throw exceptions when parsing request chunks (#441)
detail::read_content_chunked was using std::stoul to parse the
hexadecimal chunk lengths for "Transfer-Encoding: chunked" requests.
This throws an exception if the string does not begin with any valid
digits. read_content_chunked is not called in the context of a try block
so this caused the process to terminate.

Rather than use exceptions, I opted for std::stroul, which is similar to
std::stoul but does not throw exceptions. Since malformed user input is
not particularly exceptional, and some projects are compiled without
exception support, this approach seems both more portable and more
correct.
2020-04-23 09:05:45 -04:00
e1506fa186 Code cleanup 2020-04-22 21:43:16 -04:00
ad9fd3bd93 Fix #436 2020-04-22 21:42:58 -04:00
05e0253195 Fixed test error 2020-04-21 23:07:51 -04:00
da26b517a3 Added url::Get interface 2020-04-21 23:00:39 -04:00
2b7a968468 Added a unit test for URL interface 2020-04-21 21:21:31 -04:00
2ece5f116b Pass certs and keys from memory (#432)
* SSLServer: add constructor to pass ssl-certificates and key from memory

* SSLClient: add constructor to pass ssl-certificates and key from memory

* add TestCase for passing certificates from memory to SSLClient/SSLServer
2020-04-18 16:26:06 -04:00
c2b6e4ac04 Fix #431 2020-04-17 21:48:16 -04:00
85327e19ae Fix #425 2020-04-12 15:33:08 -04:00
ed8efea98b Added support for DELETE request body (#418)
* Added support for DELETE request body

* Fixed DELETE request body test case typo

Co-authored-by: Alexandre Taillefer <alexandre.taillefer@pwc.ca>
2020-04-07 15:51:52 -04:00
e1acb949e7 Fix #382 2020-03-13 18:43:29 -04:00
26deffe0c6 Not to send 'EXCEPTION_WHAT' header to client 2020-03-10 17:44:36 -04:00
c74129a1c2 Fix #372 (#374) 2020-03-09 23:59:00 -04:00
bf7700d192 Fix exception that occurs with libc++ regex engine (#368)
The regex that parses header lines potentially causes an unlimited
amount of backtracking, which can cause an exception in the libc++ regex
engine.

The exception that occurs looks like this and is identical to the
message of the exception fixed in
https://github.com/yhirose/cpp-httplib/pull/280:

	libc++abi.dylib: terminating with uncaught exception of type
	std::__1::regex_error: The complexity of an attempted match
	against a regular expression exceeded a pre-set level.

This commit eliminates the problematic backtracking.
2020-02-28 06:31:39 -05:00
3da925d6fe Adjusted a unit test. 2020-02-25 08:29:29 -05:00
ccc9a9b3f4 Remove code duplication in converting params to query 2020-02-25 02:30:34 +03:00
f2bb9c45d6 Support for deflate compression (#360) 2020-02-24 11:48:00 -05:00
9a663aa94e Added a unit test. 2020-02-21 11:48:47 -05:00
d61d63dd97 Added unit tests for SSLServer::bind_to_any_port 2020-02-14 21:59:37 -05:00
851edaf77f Code format 2020-02-02 20:02:16 -05:00
ac7742bb32 Changed the order of parameters of set_mounting_point. 2020-02-01 09:18:24 -05:00
8801e51138 Fix #341 2020-01-31 20:35:20 -05:00
5e43680486 HEAD support for static file server 2020-01-28 12:00:27 +03:00
4d545cb932 Fix #335 2020-01-21 09:09:05 -05:00
2e360f9dd6 Improved Stream interface 2020-01-16 23:28:11 -05:00
6b4df41b30 Fix #330 2020-01-14 17:02:25 -05:00
a15d16a9de Moved Stream concrete classes into detail namespace 2020-01-10 09:33:14 -05:00
7b4494748e fix indentation 2020-01-10 00:17:40 +03:00
7e1c107029 Use sleep_for and chrono for delays in tests 2020-01-10 00:15:18 +03:00
2f72845008 Fix #319 2020-01-07 23:40:11 -05:00
96e9ec0663 Improved DataSink interface 2020-01-05 23:59:54 -05:00
c58fca5dba Added more tests 2020-01-03 07:57:40 -05:00
d2fae4031c Fixed build errors 2020-01-03 01:36:59 -05:00
de844e67ef Proxy support for Keep-Alive requests 2020-01-03 01:24:07 -05:00
fcbcbd53bd Fix #306 2019-12-26 18:48:22 -05:00
aa543240db Added test for post request with query string and body 2019-12-24 21:55:29 -05:00
5675cad407 Added proxy test in Makefile 2019-12-22 21:07:26 -05:00
079d3605ea Changed to use docker-compose for squid 2019-12-22 19:11:02 -05:00
38adeaf02c Fixed problem with proxy support and added unit tests 2019-12-22 15:37:01 -05:00
eb4fcb5003 CONNECT method support on client 2019-12-20 06:59:59 -05:00
9c81693801 Fix #294 2019-12-18 17:47:36 -05:00
9a41b16cbb Fix #285. Added set_interface method on client 2019-12-15 17:44:00 -05:00
58b2814fda Format code 2019-12-14 23:50:53 -05:00
72b20c08da Better API names 2019-12-13 06:56:00 -05:00
afd6d5f9dc Removed compress parameter and added compress method on client 2019-12-12 23:09:59 -05:00
5324b3d661 Improved multipart form data interface 2019-12-12 22:48:09 -05:00
151ccba57e Code cleanup 2019-12-12 21:50:12 -05:00
d064fb7ff2 Fixed warning 2019-12-10 13:08:07 -05:00