Paul Harris
27564e9aa4
Server::respond_with_static_file() for better control over static files
...
Can now handle static file requests the same as any Get() request,
meaning the handler's priority can be controlled by the developer.
ie
svr.Get("/something", [](auto req, auto res) {
dont return the file "something";
instead, return something else;
});
svr.GET("/(.*)", [](auto req, auto res) {
// chance to further filter or adjust request to suit
auto result = svr.respond_with_static_file(
req, res, req.matches[1], "base_dir");
// optional chance to override response from the default
switch (result) {
SFR_DirRedirect: break;
SFR_File: break; // chance to set additional headers
SFR_CouldNotOpen: break; // chance to respond nicely
SFR_NotFound: break; // chance to respond nicely
}
});
2024-09-09 11:07:52 +08:00
yhirose
f35aff84c2
Fixed FuzzableServer build error
2024-09-08 19:00:23 -04:00
yhirose
7b18ae6f16
Update benchmark
2024-09-08 10:56:13 -04:00
yhirose
a79c56d06b
Fix #1796
2024-09-08 09:26:19 -04:00
yhirose
3d6e315a4c
Fix #1923
2024-09-08 08:38:36 -04:00
yhirose
4c27f9c6ef
Made default server and client read/write timeout settings separately
2024-09-07 21:06:23 -04:00
yhirose
d173a37d17
Increased CPPHTTPLIB_READ_TIMEOUT_SECOND to 300 from 5
2024-09-07 16:10:54 -04:00
yhirose
7fd346a2ca
Fix #1379
2024-09-07 16:07:45 -04:00
yhirose
c673d502b9
Update server_and_client.cc
2024-09-07 11:11:57 -04:00
yhirose
c43c51362a
Add monitor tool
2024-09-07 10:16:15 -04:00
yhirose
3e86d93d13
clangformat
2024-09-07 10:16:03 -04:00
yhirose
f6e4e2d0f3
Code cleanup
2024-09-07 10:15:22 -04:00
yhirose
01a52aa8bd
Add example/server_and_client.cc
2024-09-07 10:05:53 -04:00
yhirose
8415bf0823
Resolve #1906
2024-09-07 00:05:41 -04:00
orbea
327ff263f5
httplib.h: support LibreSSL ( #1922 )
2024-09-06 22:19:53 -04:00
yhirose
61c418048d
Release v0.17.3
2024-09-06 19:58:02 -04:00
yhirose
9720ef8c34
Code cleanup
2024-09-06 19:48:25 -04:00
yhirose
978a4f6345
Fix KeepAliveTest.SSLClientReconnectionPost problem ( #1921 )
2024-09-06 13:58:24 -04:00
bgs99
80fb03628b
Only match path params that span full path segment ( #1919 )
...
* Only match path params that span full path segment
* Fix C++11 build
2024-09-06 08:48:51 -04:00
laowai9189
2480c0342c
‘constexpr’ error ( #1918 )
...
httplib.h: In member function ‘constexpr size_t httplib::detail::case_ignore_hash::operator()(const string&) const’:
httplib.h:359:30: error: call to non-‘constexpr’ function ‘const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::data() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
359 | return hash_core(key.data(), key.size(), 0);
2024-09-06 07:23:29 -04:00
bgs99
eb6f610a45
Fix find_package for curl ( #1920 )
2024-09-06 07:22:03 -04:00
yhirose
cb74e4191b
Performance imporovement for Keep-Alive
2024-09-06 00:03:43 -04:00
yhirose
dfa641ca41
Misc
2024-09-05 22:54:48 -04:00
yhirose
969a9f99d5
Adjust sleep
2024-09-05 22:54:28 -04:00
yhirose
c099b42ba3
Removed write_format
2024-09-05 22:17:56 -04:00
yhirose
b8315278cb
Add a missing file
2024-09-05 19:35:43 -04:00
yhirose
485f8f2411
Added one more case to MountTest.Redicect unit test.
2024-09-05 17:49:12 -04:00
yhirose
953e4f3841
Adjust sleep duration
2024-09-05 17:45:09 -04:00
yhirose
adf65cfe61
Target C++11 for benchmark
2024-09-05 17:44:51 -04:00
yhirose
12c829f6d3
Fix #1389 and #1907
2024-09-05 17:44:32 -04:00
yhirose
913314f1b1
Fix warning
2024-09-05 17:43:51 -04:00
yhirose
ef63f97afe
Release v0.17.2
2024-09-05 12:57:26 -04:00
yhirose
bda74db01d
Fix fuzzing test error
2024-09-05 12:50:05 -04:00
yhirose
9ff3ff9446
Fixed build error
2024-09-05 12:27:50 -04:00
yhirose
c75d071615
Add benchmark tool
2024-09-05 12:22:46 -04:00
yhirose
b4989130da
Peformance improvement by removing tolower function call
2024-09-05 12:09:38 -04:00
yhirose
4fc0303bda
clangformat
2024-09-05 12:07:35 -04:00
yhirose
3d9cc51851
Fixed build error on Windows due to max macro in windows.h
2024-09-05 12:02:40 -04:00
Andrea Pappacoda
f69587656f
build(meson): add libcurl test dependency ( #1914 )
...
Prompted by PR #1911
2024-09-04 18:05:03 -04:00
yhirose
d5fc340c30
Update README
2024-09-04 12:23:48 -04:00
yhirose
d79a547dc9
Merge branch 'solarispika-fix-100-continue'
2024-09-04 10:17:01 -04:00
yhirose
bd1da4346a
Disable Expect100ContinueTest test on Windows
2024-09-04 09:51:36 -04:00
yhirose
4c2a608a0c
Fix GitHub Actions errors
2024-09-04 09:06:27 -04:00
yhirose
ee4eb8deaa
Merge branch 'fix-100-continue' of github.com:solarispika/cpp-httplib into solarispika-fix-100-continue
2024-09-04 08:45:48 -04:00
Sung, Po Han
7196ac8a07
Fix incorrect handling of Expect: 100-continue
...
Fix #1808
2024-09-04 17:50:42 +08:00
yhirose
c88b09bc6b
Release v0.17.1
2024-09-03 21:20:57 -04:00
yhirose
87fab847b8
Fix SIGINT problem in Docker image
2024-09-03 21:20:10 -04:00
yhirose
4e6055f084
Fix problem with Abstract Namespace Unix Domain
2024-09-03 20:56:16 -04:00
yhirose
975cf0dae5
Fix #1908
2024-09-03 18:00:12 -04:00
yhirose
4854a694cd
Use IPPROTO_IP
2024-09-03 17:29:28 -04:00