Commit Graph

1130 Commits

Author SHA1 Message Date
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
Mosolov Sergey
d59cda5677 Fixes issue 302
https://github.com/CrowCpp/Crow/issues/302
Escape only the invisible characters from 0 to 31 inclusive
Motivation: do not escape UTF8 encoding bytes
2021-12-17 08:47:00 +04:00
Navid Jalali
8de7ec2123 Missing inline specifier in http_status_str function definition fixed 2021-12-16 19:41:03 +03:30
Farook Al-Sammarraie
f96189f9f2
Merge pull request #294 from CrowCpp/parser_upgrade
upgraded parser from 2.3.0 to 2.9.4
2021-12-16 16:20:36 +03:00
Farook Al-Sammarraie
97baca78da
Merge branch 'master' into parser_upgrade 2021-12-16 12:53:24 +03:00
Farook Al-Sammarraie
9afd3c4148
Merge pull request #296 from CrowCpp/fix_signals
Fixed problems with signals
2021-12-16 12:53:13 +03:00
The-EDev
5c806252f0
formatted example.cpp 2021-12-14 06:55:59 +03:00
The-EDev
f6fd7dc85d
formatting, missing newline fixed 2021-12-11 02:38:30 +03:00
The-EDev
228e61d150
Added mustache lambda expansion 2021-12-10 05:17:25 +03:00
The-EDev
a1a4169d92
merge branch master 2021-12-10 05:12:24 +03:00
Farook Al-Sammarraie
3fb83fa1b2
Merge branch 'master' into fix_signals 2021-12-08 22:19:06 +03:00
The-EDev
14acb50030
fixed server_ name 2021-12-08 19:57:10 +03:00
Luca Schlecker
e75cc4d77d
Merge pull request #297 from Mr-Destructive/master
Fixed typos in docs/guides
2021-12-08 08:50:46 +01:00