Commit Graph

90 Commits

Author SHA1 Message Date
Muhammad
6cb8ac6f52
SlashRemover optimization (#1781) 2023-09-19 22:28:06 +08:00
An Tao
cedeeb59f4
Add a plugin for prometheus (#1632) 2023-09-04 10:16:44 +08:00
Nitromelon
53c84305b2
Simplify coroutine implementation (#1762) 2023-08-31 10:08:44 +08:00
Martin Chang
f1426c6e9a
fix race condition when setting the secure flag during test (#1742) 2023-08-23 23:58:29 +08:00
Nikolay Mitev
17c80508c0 Drop cpp14 build (#1740)
* Drop C++14 Support

* Update README.md

* Remove drogon::optional in favor of std::optional

* Remove drogon::filesystem in favor of std::filesystem

* Remove boost::string_view and pre-c++17 hacks

* Remove boost::any

* Remove the string_view.h and the any.h

* Remove boost lib

* Update .clang-format and ci

Co-authored-by: Omar Mohamed <omar@omar-laptop.lan>
Co-authored-by: Ken Matsui <26405363+ken-matsui@users.noreply.github.com>
Co-authored-by: An Tao <antao2002@gmail.com>
Co-authored-by: albaropereyra22 <141711575+albaropereyra22@users.noreply.github.com>
Co-authored-by: Yoshihiro Hokazono <47231909+hokacci@users.noreply.github.com>
Co-authored-by: Omar Mohamed Khallaf <51155980+omarmohamedkh@users.noreply.github.com>
2023-08-23 11:49:55 +08:00
An Tao
92e036874a
Fix issues in the ListParaView and content types (#1678) 2023-07-12 15:59:13 +08:00
Muhammad
61073b4f74
Base64 improvements (#1635) 2023-06-24 18:09:08 +08:00
Muhammad
269399b701
Minor improvements for SlashRemover plugin (#1634) 2023-06-14 13:46:15 +08:00
Muhammad
07726dfcab
Add SlashRemover plugin (#1614) 2023-05-26 11:08:57 +08:00
Martin Chang
122a42cd4f
Adapt Drogon to take advitange of Trantor TLS refactor (#1505)
Co-authored-by: marty1885 <marty1885@gmail.com>
2023-03-30 23:14:53 +08:00
Nitin Anand
00debb056b
Changes to free http client if no request is pending (#1529) 2023-03-14 22:41:52 +08:00
An Tao
97a5496fa4
Add queueInLoopCoro function (#1526) 2023-03-09 16:44:34 +08:00
Nitromelon
314bab0b4c
Add switchThreadCoro(). (#1501) 2023-03-09 12:13:51 +08:00
Nitromelon
bc028776f7
Refactor HttpServer codes. (#1508) 2023-02-28 10:19:26 +08:00
Martin Chang
7d87d7e0b2
Fix file r/w race condition in integration test (#1496) 2023-01-28 13:19:16 +08:00
Martin Chang
36d7435d1d
add coroutine parameter binding test and make tests not blocking (#1493) 2023-01-28 10:33:04 +08:00
Greisberger Christophe
28518b7bba
Fix HttpController regex path matching (#1439)
* Fixed wrong controller method called on regex paths

* Fixed test executables not linking on Windows

* Fixed compilation conversion warnings with explicit casts
2022-11-17 21:56:12 +08:00
Francesco Emanuele D'Agostino
1b11bfb668
add onSessionStart() and onSessionDestroy() events (#1412)
Co-authored-by: an-tao <antao2002@gmail.com>
2022-11-13 22:40:24 +08:00
An Tao
6a397efefe
Fix a test bug when clients start before servers (#1376) 2022-09-09 01:32:01 +08:00
An Tao
c40bb2bc1f
Fix a bug when parsing multipart/form-data (#1358) 2022-08-25 23:04:23 +08:00
Nitromelon
bd9d290b82
Support coroutine filter. (#1352) 2022-08-19 09:24:02 +08:00
An Tao
a1d2bd168b
Change the listener port of the cookie test (#1336) 2022-07-31 12:56:49 +08:00
Nitromelon
bf36db1562
Resolve real ip from HttpRequest. (#1321) 2022-07-28 23:34:35 +08:00
Ken Matsui
cfe1681b0f
Omit redundant virtual specifiers (#1325) 2022-07-26 12:19:54 +08:00
Ken Matsui
a582a773c1
Remove an unnecessary semi-colon (#1323) 2022-07-26 12:16:48 +08:00
Martin Chang
9524a91479
Support compressed request (#1291) 2022-07-02 22:07:48 +08:00
LE GARREC Vincent
b8f44aec2e
Rename BUILD_TRANTOR_SHARED to BUILD_SHARED_LIBS (#1299) 2022-06-29 17:29:20 +08:00
LE GARREC Vincent
e2b5a07921
Fix no BUILD_CTL with tests (#1300) 2022-06-29 17:26:37 +08:00
Robert Huang
3b0fd3d676
Fix HttpFile unittest error on Windows (#1191) 2022-05-17 13:20:05 +08:00
JuergenGleiss
19d9ffcfc2
Bugfix/cookie same site test without any useful checks (#1247)
Co-authored-by: an-tao <antao2002@gmail.com>
2022-05-16 11:18:10 +08:00
JuergenGleiss
c5a1888da3
Feature/option same site for session cookie (#1221) 2022-05-08 13:47:18 +08:00
LE GARREC Vincent
8c4896dfec
Fix tolower with cfi sanitizer (#1209) (#1210)
and update trantor with same patch.
2022-04-22 11:08:40 +08:00
Martin Chang
b9bbe45642
Fix XXXControllers created on MSVC even if specsfied not to do so (#1183)
Co-authored-by: marty1885 <marty1885@gmail.com>
2022-02-26 00:19:48 +08:00
Kirill
3c785326c6
Prevent malformed upload path causing arbitrary write (#1174) 2022-02-11 23:54:42 +08:00
juanetch
bbc31612fc
add max-age, samesite options to Cookie (#1159)
Co-authored-by: an-tao <antao2002@gmail.com>
2022-01-16 11:40:17 +08:00
Nitromelon
68b2a46a29
Start listening after beginning advices (#1147) 2022-01-07 21:45:09 +08:00
Martin Chang
6b677a3ff6
Fix WS test potentially can get stuck (#1124) 2021-12-12 11:18:59 +08:00
Martin Chang
9448c19865
Fix coroutine objcet destructing before coroutine ends in async_run (#1069) 2021-11-02 13:56:18 +08:00
NitroMelon
0431f38a4e
Support range for static file (#1060) 2021-10-28 21:53:58 +08:00
Martin Chang
ac4a816a99
Add async_run (#1047) 2021-10-03 16:31:52 +08:00
An Tao
4a6f298661
Update trantor (#1046) 2021-10-03 16:31:26 +08:00
An Tao
22f810a71b
Fix a race condition in testing (#1041) 2021-09-30 08:49:35 +08:00
Martin Chang
56cb305ae3
Support custom MIME types and extensions (#1024)
* Drogon now support custom extension and MIME types
* Added contentTypeString() to retrieve the string version of content type (in case the content type is not in the ContentType enum)
* setCustomContentTypeAndString() also accepts MIME as input (instead of the full content-type header string),
* Remove webContentTypeToString()
* Added app().registerCustomExtensionMime()
* Added support to load custom extension from JSON config
2021-09-24 22:51:09 +08:00
NitroMelon
b2bf247048
Support sending files by range (#1001) 2021-08-26 23:33:58 +08:00
An Tao
d60f962aa3
Add stop() method to the WebSocketClient class (#972)
* Fix memory leak in the WebSocketClient class

Co-authored-by: marty1885 <marty188586@gmail.com>
2021-08-15 18:17:05 +08:00
Martin Chang
88236f9279
Add port() and host() to HttpClient (#959) 2021-08-05 23:10:05 +08:00
Martin Chang
0b9d114746
Fix Failing to Build on MSYS2 (#952) 2021-07-27 10:53:04 +08:00
putao520
64f9f8b87f
Fix a md5 sum bug without openssl (#951) 2021-07-25 23:16:13 +08:00
Martin Chang
b8d820fc2a
Fix single layer directory traversal in StaticFileRouter (#901)
The StaticFileRouter can access file in the immediate parent directory if the
client sends a specially crafted, non RFC conforming HTTP 1.x request. By
sending a HTTP request without a "/" predicating the path. The StaticFileRouter
fails to detect directory traversal since it checks for "/../" in the path.

This PR fixes the issue by detecting if there's potential for directory
traversal. If true, we follow the path and detect if it reaches out of the
document root at any point. Also added 2 new tests for edge cases in static
file serving. (Not related to the bug).

Co-authored-by: an-tao <antao2002@gmail.com>
Bug discovered by: oToToT <https://github.com/oToToT>
2021-06-24 13:04:19 +08:00
Martin Chang
834e3eabdd
Fix CacheMap crash in CI tests (#890)
It is possible for the CacheMap to destruct while timeout callback is
active. This causes a very rare data race. And it's my hypothesis that
this is the reason behind CacheMap crashes on CI. This patch locks the
weels upon cestructing.
2021-06-13 10:33:30 +08:00