yhirose
3b35279b16
Added SSLServer::ssl_context()
2021-12-18 00:21:41 -05:00
yhirose
27deb44df5
Update SSL related code
2021-12-18 00:15:38 -05:00
yhirose
24a3ef949b
Performance improvement for multipart form data file upload.
2021-12-18 00:15:10 -05:00
yhirose
793ae9855e
Fix #1041 ( #1132 )
...
* Fix #1041
* Fixed problem with is_socket_alive
* Adjust the way to check if the sockt is still alive.
* Revert "Adjust the way to check if the sockt is still alive."
This reverts commit 6c673b21e5 .
* Adjust is_socket_alive according to the code review
2021-12-16 21:06:17 -05:00
yhirose
cec6288a99
Resolve #1131
2021-12-14 07:58:21 -05:00
yhirose
9639578c2a
Release v0.9.10
2021-12-11 19:26:22 -05:00
yhirose
743ecbd365
Issue1121 ( #1122 )
...
* Fixed test/Makefile problem when cleaning *.pem files
* Fix #1121
2021-12-11 19:07:12 -05:00
yhirose
ddff782133
Release v0.9.9
2021-11-26 20:46:38 -05:00
yhirose
3051152103
Fix #1102 ( #1108 )
2021-11-26 20:44:58 -05:00
yhirose
06026bb47d
Code formating
2021-11-23 10:53:05 -05:00
yhirose
226388ae27
Resolve #1100
2021-11-23 10:47:30 -05:00
Scott Graham
ea7548b4cc
Remove stray ; causing warning with -Wextra-semi ( #1099 )
2021-11-22 07:16:07 -05:00
Rodolphe
c7486ead96
accept protobuf encoding ( #1096 )
...
Co-authored-by: rodolphe <rodolphe@zen.ly>
2021-11-17 13:14:31 -05:00
yhirose
ec56dfa35e
Fix #1085 ( #1091 )
2021-11-15 14:37:10 -05:00
zhenyolka
4f8fcdbaf7
Allow to specify server IP address ( #1067 )
...
* Allow to specify server IP address
* Reimplement in set_hostname_addr_map
* Add tests for set_hostname_addr_map
* Fix tests after implement set_hostname_addr_map
* SpecifyServerIPAddressTest.RealHostname typo
2021-10-16 15:05:55 -04:00
CarlosLeeGit
b80aa7fee3
support custom ssl ctx configuration for SSLServer ( #1073 )
2021-10-15 07:13:16 -04:00
yhirose
d17ac3bb40
Fix "Issue 39922 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzzer"
2021-10-14 08:55:29 -04:00
yhirose
c7554ccac2
Fix #1069 ( #1070 )
2021-10-09 20:35:58 -04:00
estshorter
3da42fd1e8
Avoid min/max macro expansion on Windows ( #1057 )
2021-09-25 08:53:15 -04:00
yhirose
503aa61325
Fix problem with an empty parameter in set_base_dir
2021-09-20 17:40:05 -04:00
Zizheng Tai
e1efa337a2
Make Client move-constructible ( #1051 )
2021-09-16 14:05:42 -04:00
yhirose
3c522386e9
Fix "Issue 38551 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzze"
2021-09-12 19:24:48 -04:00
yhirose
c202aa9ce9
Read buffer support. ( Fix #1023 ) ( #1046 )
2021-09-12 00:26:02 -04:00
yhirose
4e05368086
Fix #1054
2021-09-11 14:13:49 -04:00
yhirose
e1afe74fe2
Fix #1037
2021-09-10 22:42:14 -04:00
Gregor Jasny
415edc237c
Set error variable for failed write_data ( #1036 )
2021-09-05 16:15:46 -04:00
yhirose
ab477b5631
Fix "Issue 37742 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzzer"
2021-09-02 22:57:57 -04:00
yhirose
0823d5c7f2
Fixed #1031
2021-08-30 17:16:31 -04:00
yhirose
4297500928
Fix #1024
2021-08-17 09:28:17 -04:00
Thomas Behn
a58f042614
Don't define INVALID_SOCKET if it has been defined already (i.e. by libpcap) ( #1021 )
...
Co-authored-by: Thomas Behn <Thomas.Behn@meinberg.de>
2021-08-10 08:29:27 -04:00
Joel Rosdahl
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
Joel Rosdahl
9c2c15ca45
Add missing template method implementations ( #1013 )
...
When using the split version of httplib.h the templated implementation
of e.g. Client::set_connection_timeout ends up in httplib.cc and
therefore results in a linker error since the needed template
specialization has not been instantiated. Fix this by moving the
implementation of template methods into the part that ends up in
httplib.h after the split.
Fixes #1008 .
2021-07-30 10:05:49 -04:00
yosh-matsuda
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
xxrl
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
Gregor Jasny
ea2f69a0d7
Add httplib::Error to std::string function ( #999 )
...
Fixes : #978
2021-07-19 21:17:44 -04:00
yhirose
e3750d9ddf
Simplefied server APIs
2021-07-17 18:09:30 -04:00
yhirose
c1eee3012e
Fix #998
2021-07-17 17:18:56 -04:00
yhirose
06bfa7e08b
Fix #979
2021-07-14 22:49:49 -04:00
yhirose
3d83cbb872
Improve string compare performance
2021-07-12 23:51:56 -04:00
yhirose
8a803b30f6
Fix #990
2021-07-12 23:46:25 -04:00
yhirose
80be649de7
Fix #961
2021-06-26 18:26:33 -04:00
Gregor Jasny
6b9ffc8bec
Remove dead code ( #965 )
2021-06-18 07:20:34 -04:00
Simon Edlund
d903053faf
Update httplib.h ( #964 )
...
operator""_ replaced by operator""_t
2021-06-17 10:57:25 -04:00
yhirose
676f1b5a26
Updated the user agent string
2021-06-14 08:43:12 -04:00
Baruch Nissenbaum
b8dec12f15
Limit SSL_ERROR_WANT_READ retries to 1 sec ( #957 )
...
retry with 1ms delays to prevent CPU hoggin
2021-06-14 08:41:20 -04:00
yhirose
fc9b223acc
Updated copyright year
2021-06-11 14:45:35 -04:00
CncGpp
ba824089d7
Fix code err code 401 when the password is empty in base_auth. ( #958 )
2021-06-11 14:39:33 -04:00
yhirose
5a43bb8149
Implemented #946 in a different way
2021-06-02 13:45:47 -04:00
yhirose
0104614656
Code refactoring
2021-06-02 08:11:31 -04:00
yhirose
77a77f6d2d
Added set_default_headers on Server
2021-05-23 19:06:28 -04:00
Mathias Laurin
089b9daa1c
Fix virtual call in ClientImpl::~ClientImpl() ( #942 )
...
* Fix virtual call in ClientImpl::~ClientImpl()
This fixes a warning in clang tidy:
> Call to virtual method 'ClientImpl::shutdown_ssl' during
> destruction bypasses virtual dispatch
ClientImpl::~ClientImpl() calls lock_socket_and_shutdown_and_close()
that itself calls shutdown_ssl(). However, shutdown_ssl() is virtual
and C++ does not perform virtual dispatch in destructors, which results
in the wrong overload being called.
This change adds a non-virtual shutdown_ssl_impl() function that is
called from ~SSLClient(). We also inline sock_socket_and_shutdown_and_close()
and removes the virtual call in ~ClientImpl().
* Inline and remove lock_socket_and_shutdown_and_close()
The function only has one caller.
2021-05-22 20:15:20 -04:00
yhirose
ba34ea4ee8
Fix #944
2021-05-22 19:24:50 -04:00
Baruch Nissenbaum
2917b8a005
Explicit cast from size_t to uInt ( #941 )
...
* Explicit cast from size_t to uInt
* static_cast<uInt> instead of C style cast
2021-05-19 18:03:59 -04:00
yhirose
75fdb06696
Added a missing member in copy_settings.
2021-05-15 09:14:44 -04:00
Alex Hornung
e00ad37580
Add option to bypass URL encode of path ( #934 )
2021-05-15 08:48:25 -04:00
Vincent Stumpf
5cfb70c2b4
Fix some shadowed variable warnings ( #935 )
2021-05-15 08:46:16 -04:00
Alessio Pollero
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
Aswin Raj Kharel
c58b00580e
reserving before encoding ( #912 )
2021-04-24 16:19:14 -04:00
Ken Schalk
7c60e69c33
Remove redunant call to close_socket ( #911 )
2021-04-23 17:07:19 -04:00
yhirose
73e0729f63
Change sink.write() to return boolean
2021-04-22 07:14:08 -04:00
yhirose
21c529229c
Fixed timeout issues
2021-04-22 07:14:08 -04:00
yhirose
63643e6386
Code format
2021-04-13 20:52:49 -04:00
yhirose
6cc2edce99
Added set_address_family
2021-04-13 20:49:52 -04:00
yhirose
d122ff3ca8
Code formatting
2021-04-13 12:38:45 -04:00
James Young
14c6d526b4
Use newer version-flexible TLS/SSL method ( #904 )
2021-04-13 09:11:38 -04:00
Philipp Hasper
28e07bca16
Fixed minor code smells ( #901 )
2021-04-09 14:55:21 -04:00
yhirose
faa5f1d802
Additional changes for #889
2021-04-05 16:13:41 -04:00
yhirose
9d3365df54
Fix #889
2021-04-05 11:40:53 -04:00
yhirose
6ff84d34d1
Another simpler implementation of #890 ( #891 )
2021-04-02 18:25:04 -04:00
yhirose
b845425cd0
Fix #878
2021-03-16 19:42:44 -04:00
yhirose
89519c88e2
Fix #874
2021-03-10 15:57:56 -05:00
yhirose
ff813bf99d
Fix #863
2021-02-17 15:36:56 -05:00
yhirose
cf475bcb50
Fix #860
2021-02-12 12:21:43 -05:00
yhirose
b7566f6961
Resolve #852
2021-02-02 22:09:35 -05:00
Nikolas
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
yhirose
88411a1f52
Fix #846
2021-01-27 14:35:32 +00:00
yhirose
68d1281759
Resolve #839
2021-01-23 13:33:27 -05:00
yhirose
0308d60cb2
Resolve #831 ( #835 )
2021-01-23 12:23:06 -05:00
yhirose
59f5fdbb33
Resolve #840
2021-01-23 11:43:01 -05:00
Anonymous
13184f5f80
Return Server& from handler setters ( #836 )
...
* Update httplib.h
* Update httplib.h
* Update httplib.h
* Update httplib.h
2021-01-22 09:20:21 -05:00
Eric Lee
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
yhirose
f008fe4539
Added middleware support ( #816 )
2021-01-07 18:40:52 -05:00
yhirose
ddf41d29ef
Added const *char and size_t interface
2021-01-06 22:39:58 -05:00
yhirose
3f88a46c4a
Code format
2020-12-31 18:14:28 -05:00
yhirose
242706ea34
Fix #820
2020-12-31 18:14:05 -05:00
yhirose
a9f5f8683f
Fixed warnings on Visual C++
2020-12-31 11:35:11 -05:00
yhirose
60c2213893
Fix #817
2020-12-31 10:58:44 -05:00
yhirose
eb2d28bca2
Code cleanup
2020-12-31 10:37:06 -05:00
yhirose
2c07ec4600
Code cleanup
2020-12-29 09:39:19 -05:00
yhirose
871d8d67b0
Made Request paramater const in handle_file_request
2020-12-28 22:03:44 -05:00
yhirose
e9c6c6e609
Code format
2020-12-19 20:14:53 -05:00
yhirose
40db42108f
Fixed problem with invalid requests including spaces in URL path
2020-12-19 12:03:08 -05:00
Jeremie Rahm
d0bd4afb0b
Ensure socket is closed after processing in SSLServer ( #804 )
2020-12-18 19:29:36 -05:00
Yuri Santos
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
Anonymous
0cff3245df
Extend built-in extension MIME mapping ( #799 )
...
* Update README.md
* Update httplib.h
* Update httplib.h
* Update httplib.h
* Update httplib.h
* Remove duplicate cases
Someone left a bunch of duplicate cases, idiot, couldn't have been me.
* Reformat
Modify spacing and whatnot
* Update README.md
2020-12-18 09:32:19 -05:00
yhirose
0e3925db3f
Fixed build error
2020-12-18 00:07:48 +00:00
yhirose
c9a13d214b
Changed not to use string_view
2020-12-17 18:48:27 -05:00
yhirose
0954af2d4c
Use user-defined literals for file extention match
2020-12-17 18:27:04 -05:00
yhirose
7c1c952f5a
Don't allow invalid status code format (It sould be a three-digit code.)
2020-12-15 20:25:24 -05:00
yhirose
c1264bfedc
Fix problem with mp4 w/ Range header
2020-12-14 22:41:05 -05:00