Commit Graph

1192 Commits

Author SHA1 Message Date
The-EDev
dcd2b0c318
format 2022-02-08 19:22:09 +03:00
The-EDev
6ad068494f
sanitize load_text() path 2022-02-08 19:14:55 +03:00
The-EDev
155cf759eb
fixed issue where absolute unix paths were not sanitized 2022-02-08 19:11:46 +03:00
Vhuynh25
c44fec82bf
added space to match clang format 2022-02-06 11:58:41 -08:00
The-EDev
175b004c26
code formatting (also disabled formatting where not applicable) 2022-02-06 22:29:46 +03:00
The-EDev
15908e5498
fixed problem with compression test 2022-02-06 21:01:22 +03:00
The-EDev
75b100527f
Merge branch 'refs/heads/master' into parser_optimization 2022-02-05 18:35:01 +03:00
The-EDev
4cdde73388
Optimized HTTP parser
Also (likely) fixed problem with streaming without keeping connection
alive
Also fixed problem with multipart hanging on request
Also updated TODO entries to indicate Writer
2022-02-05 18:15:19 +03:00
Vhuynh25
781a40bee1
fixed clang format 2022-02-03 09:07:54 -08:00
brian.orwe
291b6aef37 Fix vcpkg.json to work with those building on linux 2022-02-03 13:28:45 +03:00
Vladislav Oleshko
5d6db06706 Add local middleware after handlers to request handler 2022-02-02 17:37:19 +03:00
Vien Huynh
c21ae7ea3e change NaN output warning message 2022-02-01 16:40:07 -05:00
Vien Huynh
a134e2b9ff fixed NaN handling errors 2022-02-01 15:31:09 -05:00
Vladislav Oleshko
69e9ad9c1e Run clang format 2022-02-01 23:21:07 +03:00
Vladislav Oleshko
39e5eb427d Update docs 2022-02-01 22:50:01 +03:00
Vladislav Oleshko
e60714c0b2 Separate middleware for handlers 2022-02-01 22:49:41 +03:00
Vien Huynh
9af906dc21 fixed JSON outputting NaN and infinite values 2022-01-30 23:43:30 -05:00
Farook Al-Sammarraie
9f64a7b667
Merge pull request #326 from neumannt/json-crash
defend against excessive recursion in json::load
2022-01-29 11:39:21 +03:00
Farook Al-Sammarraie
9689688193
Merge branch 'master' into json-crash 2022-01-29 11:39:10 +03:00
Farook Al-Sammarraie
2807953445
Merge pull request #325 from neumannt/const-render
fix const correctness in template_t
2022-01-29 11:38:59 +03:00
Thomas Neumann
3569c93984 defend against excessive recursion in json::load
Passing a deeply nested JSON structure to json::load leads to a crash
due to stack overflow. We handle this now gracefully by limiting the
maximum nesting depth to 10,000.

Test case:

https://github.com/nst/JSONTestSuite/blob/master/test_parsing/n_structure_100000_opening_arrays.json
2022-01-25 08:48:36 +01:00
Thomas Neumann
2a77083524 fix const correctness in template_t
Without locking we can safely share only const objects between threads.
crow::mustache::template_t will typically be loaded once and then
reused many times across threads. Unfortunately the render() method
was not marked as const, even though it is const is practice. This commit
adds the missing const annotations to the methods involved.
2022-01-24 20:41:29 +01:00
Farook Al-Sammarraie
c5d4fe4fe8
Merge pull request #321 from neumannt/sanitize_filename
Improve sanitize_filename
2022-01-24 11:39:40 +03:00
Thomas Neumann
74e5fa8c87 improve sanitize_filename
The old implementation allocated a new string for every invocation, and
repeatedly scanned the string for occurences of the various Windows device
names. This commits resizes the original string instead if needed, and
detects all devices with a single pass.
2022-01-24 08:08:20 +01:00
Farook Al-Sammarraie
9868685079
Merge pull request #324 from neumannt/base64decode
avoid memory allocation in base64decode
2022-01-24 09:50:46 +03:00
Thomas Neumann
15085a9f95 avoid memory allocation in base64decode
Every single call to base64decode allocates a mapping table for all
base64 characters. This is quite wasteful, as the map is in fact static.
We could use a static variable here, but that would have unpleasant consequences
if we ever encounter input with non-valid base64 characters (which
implicitly modifies the map).

The number of character ranges for base64 is quite low (3, plus 4 exceptions),
thus we can simply check that explicitly in code instead of using a dynamic hash table.
2022-01-24 07:24:34 +01:00
Farook Al-Sammarraie
8f4830b5a1
Merge pull request #322 from neumannt/update-catch2
update catch2 to v2.13.8
2022-01-23 05:42:27 +03:00
Thomas Neumann
092b4456d0 update catch2 to v2.13.8 2022-01-22 19:27:08 +01:00
The-EDev
05274f1900
update site copyright 2022-01-12 06:17:36 +03:00
Farook Al-Sammarraie
8cfdfca76e
Merge pull request #317 from CrowCpp/fix_vulnerabilities
Fix vulnerabilities
2022-01-11 22:47:20 +03:00
The-EDev
e688cbd18e
Fixed another vulnerability in mustache file loading
and made the file sanitizer a copy-less function
2022-01-11 21:48:51 +03:00
The-EDev
0a16021442
Fix vulnrabilities in mustache and static 2022-01-11 20:27:41 +03:00
Farook Al-Sammarraie
2a6fa2d871
Merge pull request #311 from CrowCpp/new_contrib_style
Make contributors section nice
2021-12-31 14:48:32 +03:00
Farook Al-Sammarraie
27a6c6e3bd
Merge branch 'master' into new_contrib_style 2021-12-31 03:59:33 +03:00
The-EDev
b98ed1b875
Changed Contributors section to a new style that includes GitHub contributors 2021-12-31 03:52:29 +03:00
Farook Al-Sammarraie
d668fa1fec
Merge pull request #307 from CrowCpp/concurrency_fix
Fix inconsistencies in `concurrency`
2021-12-24 23:09:51 +03:00
The-EDev
7aee13eee9
Changed the way concurrency is used
(it actually reflects the thread count properly)
2021-12-23 05:39:39 +03:00
The-EDev
77758e6241
Have concurrency represent the actual number threads used 2021-12-20 11:04:55 +03:00
Luca Schlecker
f4785cda68
Merge pull request #305 from navidcity/uninstall_target
Uninstall target as mentioned in #138
2021-12-19 16:59:54 +01:00
Navid Jalali
115d6c7922 Moving cmake_uninstall.cmake.in to cmake directory and changing the path in CMakeLists.txt 2021-12-19 10:57:17 +03:30
Navid Jalali
e72559d35c Introducing the uninstall (custom) target to CMake 2021-12-18 10:30:51 +03:30
Navid Jalali
a862a6a66f Initial commit. Uninstall target. 2021-12-18 10:30:10 +03:30
Farook Al-Sammarraie
680fb4cf74
Merge pull request #299 from CrowCpp/mustache_lambdas
Mustache lambda support
2021-12-17 23:45:10 +03:00
Farook Al-Sammarraie
fa77468a88
Formatting 2021-12-17 09:45:50 +03:00
Farook Al-Sammarraie
0ef48e82bb
Fixed scoping issue
introduced by initializing `execute_result`
2021-12-17 09:30:58 +03:00
Farook Al-Sammarraie
790e34cea8
Merge branch 'master' into mustache_lambdas 2021-12-17 09:08:24 +03:00
Farook Al-Sammarraie
cca1d54ce5
took repeated code out of the if else statement 2021-12-17 09:07:46 +03:00
Farook Al-Sammarraie
51d6d0526a
Merge pull request #304 from mosolovsa/issue-302
Fixes issue where `crow::json` escapes UTF-8 characters above value `127`
2021-12-17 08:33:17 +03:00
Farook Al-Sammarraie
ddc1f18a1e
Merge branch 'master' into issue-302 2021-12-17 08:11:57 +03:00
Farook Al-Sammarraie
981dc580be
Merge pull request #303 from navidcity/new_parser_branch
Missing inline specifier in http_status_str function definition fixed
2021-12-17 08:11:11 +03:00