Commit Graph

1517 Commits

Author SHA1 Message Date
Farook Al-Sammarraie
1c98bbb860
Merge branch 'master' into local-middleware 2022-02-14 22:17:19 +03:00
Vladislav Oleshko
b9dded57e8 Remove is_callable impl 2022-02-13 14:35:11 +03:00
Farook Al-Sammarraie
ab0f18b102
Merge pull request #342 from CrowCpp/fix-mustache
fix missing `;` in mustache escaping
2022-02-12 05:54:57 +03:00
Farook Al-Sammarraie
9b0f7fdb90
Update mustache.h 2022-02-11 18:26:26 +03:00
Farook Al-Sammarraie
610e82451a
Merge pull request #339 from zefrenchy/master
Added unsafe load functions (allows absolute file for special cases)
2022-02-11 13:15:19 +03:00
Farook Al-Sammarraie
ebef1caa08
Merge branch 'master' into master 2022-02-11 12:51:22 +03:00
Dominique Jacquel
787506350f Add unsafe/unsanitized load functions 2022-02-11 09:48:33 +00:00
The-EDev
4e2074dcb5
ran clang-format 2022-02-11 01:04:32 +03:00
The-EDev
9a7677bf1a
Applied changes from review
Also moved builtin_expect to utility.h (for use in sanitizer function)
2022-02-11 00:56:30 +03:00
Farook Al-Sammarraie
ab50fb3134
Merge branch 'master' into parser_optimization 2022-02-11 00:46:19 +03:00
Farook Al-Sammarraie
5a651b0d0e
Merge pull request #338 from CrowCpp/fix_404_static
Static file 404 fix
2022-02-10 18:50:14 +03:00
The-EDev
9f6e099f10
fixed issue where content length was being set but body wasn't being sent 2022-02-09 20:57:12 +03:00
Farook Al-Sammarraie
e8e46266b3
Merge pull request #328 from Vhuynh25/master
Ignore NaN and infinite values in json::wvalue
2022-02-09 13:27:04 +03:00
Vhuynh25
07a2422c63
changed output to null and changed warning message
also changed from <cmath> to <math.h>
2022-02-08 15:45:49 -08:00
Vhuynh25
7672f3a0f9
Merge branch 'CrowCpp:master' into master 2022-02-08 18:42:38 -05:00
Farook Al-Sammarraie
e958cef69c
Merge pull request #330 from Borwe/my_dev
Fix vcpkg.json to work with those building on linux
2022-02-08 23:26:22 +03:00
Farook Al-Sammarraie
dfe180d5bd
Merge branch 'master' into my_dev 2022-02-08 23:26:05 +03:00
Farook Al-Sammarraie
a63b0806cc
Merge pull request #334 from CrowCpp/sanitize_absolute_path
fixed issue where absolute unix paths were not sanitized
2022-02-08 23:25:21 +03:00
Vladislav Oleshko
a5ba69f5a4 Update test for completion handler fix 2022-02-08 21:57:39 +03:00
Vladislav Oleshko
0b1eb12f60 Fix nonempty completion handler before middleware call 2022-02-08 21:15:25 +03:00
Vladislav Oleshko
80bc1cf00a Fix clang format 2022-02-08 20:18:49 +03:00
Vladislav Oleshko
4f4e12c91a Add CROW_MIDDLEWARES macro 2022-02-08 20:11:02 +03:00
Vladislav Oleshko
f1dd5cc78a Add example_middleware to build 2022-02-08 19:37:24 +03:00
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