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

470 Commits

Author SHA1 Message Date
c202aa9ce9 Read buffer support. (Fix #1023) (#1046) 2021-09-12 00:26:02 -04:00
e3e28c6231 meson: add tests (#1044)
This integrates the "main" test suite (test/test.cc) in Meson.

This allows to run the tests in the CI with the Meson-built version of
the library to ensure that nothing breaks unexpectedly.

It also simplifies life of downstream packagers, that do not have to
write a custom build script to split the library and run tests but can
instead just let Meson do that for them.
2021-09-11 14:26:48 -04:00
461acb02f5 Comment out SlowPostFail test for now 2021-09-10 22:37:31 -04:00
1cc6930363 Append '_Online' suffix to Unit test names that access external servers 2021-08-23 13:02:19 -04:00
887074efd2 Add test of httplib.h split into .h + .cc (#1015)
In order to test the split version (.h + .cc via split.py):

- Added a test_split program in the test directory whose main purpose is
  to verify that it works to compile and link the test case code against
  the split httplib.h version.
- Moved types needed for test cases to the “header part” of httplib.h.
  Also added forward declarations of functions needed by test cases.
- Added an include_httplib.cc file which is linked together with test.cc
  to verify that inline keywords have not been forgotten.

The changes to httplib.h just move code around (or add forward
declarations), with one exception: detail::split and
detail::process_client_socket have been converted to non-template
functions (taking an std::function instead of using a type parameter for
the function) and forward-declared instead. This avoids having to move
the templates to the “header part”.
2021-07-31 09:53:30 -04:00
1b3b098329 Avoid hardcoded ports in RedirectToDifferentPort.Redirect test (#1012)
The RedirectToDifferentPort.Redirect test assumes that port 8080 and
8081 are available on localhost. They aren’t on my system so the test
fails. Improve this by binding to available ports instead of hardcoded
ones.
2021-07-30 10:04:02 -04:00
ccbddd8842 Allow LargeRandomData test only on Windows 2021-07-22 22:17:31 -04:00
879dd261c2 Fix gzip compression/decompression over 4 GiB data size (#1002)
* Fix gzip compression/decompression over 4 GiB data size

* Add gzip test for large random data
2021-07-22 22:07:40 -04:00
52f5eb5980 [Fix] ca_cert_path/ce_cert_store lose (#1004)
When redirect from http to https, user setting for ca_cert will lose

issue: #1003
2021-07-22 21:41:41 -04:00
ea2f69a0d7 Add httplib::Error to std::string function (#999)
Fixes: #978
2021-07-19 21:17:44 -04:00
9f2064a8ed Fix remaining test warnings (#1001)
* Use portable way to encode ESC

'\e' is a GNU extension

* Use length specifier for size_t
2021-07-19 21:17:18 -04:00
c1eee3012e Fix #998 2021-07-17 17:18:56 -04:00
6b08babbd2 Use googletest 1.11.0 (#1000)
* Update googletest to version 1.11.0

* Fix test warnings
2021-07-17 13:21:03 -04:00
215b81342e Added a test case for #996 2021-07-15 08:24:06 -04:00
06bfa7e08b Fix #979 2021-07-14 22:49:49 -04:00
5a43bb8149 Implemented #946 in a different way 2021-06-02 13:45:47 -04:00
77a77f6d2d Added set_default_headers on Server 2021-05-23 19:06:28 -04:00
e00ad37580 Add option to bypass URL encode of path (#934) 2021-05-15 08:48:25 -04:00
2a70c45697 Fix client.cc code, since res.error() without operator overloading… (#921)
* Fix client.cc code, since res.error() without operator overloading causing error in Xcode

* Add unit test to check new error to string with operator overloading

* Add inline as requested in code review comment
2021-05-01 13:29:23 -04:00
33e94891ee Updated test.cc 2021-04-22 08:04:46 -04:00
73e0729f63 Change sink.write() to return boolean 2021-04-22 07:14:08 -04:00
21c529229c Fixed timeout issues 2021-04-22 07:14:08 -04:00
63643e6386 Code format 2021-04-13 20:52:49 -04:00
6cc2edce99 Added set_address_family 2021-04-13 20:49:52 -04:00
9d3365df54 Fix #889 2021-04-05 11:40:53 -04:00
6ff84d34d1 Another simpler implementation of #890 (#891) 2021-04-02 18:25:04 -04:00
b845425cd0 Fix #878 2021-03-16 19:42:44 -04:00
cf475bcb50 Fix #860 2021-02-12 12:21:43 -05:00
bc80d7c789 Fixed ClientStop test problem 2021-02-06 20:12:30 -05:00
b7566f6961 Resolve #852 2021-02-02 22:09:35 -05:00
0542fdb8e4 Add exception handler (#845)
* Add exception handler

* revert content reader changes

* Add test for and fix exception handler

* Fix warning in test

* Readd exception test, improve readme note, don't rethrow errors, remove exception handler response
2021-01-28 17:19:11 -05:00
68d1281759 Resolve #839 2021-01-23 13:33:27 -05:00
0308d60cb2 Resolve #831 (#835) 2021-01-23 12:23:06 -05:00
8d9a477edb No content check (#823)
* No content check

* unit test for no content

* fixing merge conflict break

* oops during manual merge conflict
2021-01-13 17:51:40 -05:00
f008fe4539 Added middleware support (#816) 2021-01-07 18:40:52 -05:00
ddf41d29ef Added const *char and size_t interface 2021-01-06 22:39:58 -05:00
3f88a46c4a Code format 2020-12-31 18:14:28 -05:00
a9f5f8683f Fixed warnings on Visual C++ 2020-12-31 11:35:11 -05:00
86f637a246 Added encode_uri_param tests with UTF-8 characters (#818)
Remove additional lines between tests
2020-12-30 23:06:36 -05:00
b9641048fc Switch to hghttp2.org/httpbin for redirect test. (#538) 2020-12-19 20:27:52 -05:00
e9c6c6e609 Code format 2020-12-19 20:14:53 -05:00
40db42108f Fixed problem with invalid requests including spaces in URL path 2020-12-19 12:03:08 -05:00
78ea786abd [PR] Special function to encode query params (#801)
* Special function to encode query params

* Fix #include <iomanip>

* Added unescaped charsets to encode_query_param

* Unit tests for encode_query_param
2020-12-18 17:51:11 -05:00
7c1c952f5a Don't allow invalid status code format (It sould be a three-digit code.) 2020-12-15 20:25:24 -05:00
a6edfc730a Added a unit test for static file with range 2020-12-15 18:47:51 -05:00
88c961f37e Removed std::atomic<Error> error_ 2020-12-01 15:17:34 +00:00
b952376968 Fixed warning 2020-12-01 03:50:55 +00:00
5dd605d3a2 Fix #762 2020-11-30 21:49:31 -05:00
02d3cd5909 Fix multiple threading bugs including #699 and #697 2020-11-29 12:29:15 -05:00
a5c239c174 Fix #765 2020-11-21 16:35:31 -05:00