Commit Graph

614 Commits

Author SHA1 Message Date
Michael Schreckenbauer
c593fbb3b4 only allow regular files in set_static_file_info, return 404 in all other cases 2022-06-15 09:20:11 +02:00
erik
3782044249 Fixed race condition: calling stop() immediately after async_run() and wait_for_server_start() could lead to deadlock
This is the case in some short, simple unit tests, such as "get_port".
2022-06-13 10:53:27 +02:00
Alexander Goussas
6bac5d948b fix qs_parse eating first character in form keys 2022-06-11 21:44:53 -05:00
Michael Schreckenbauer
efee71745b do not try to read from websocket after sending and receiving the close frame 2022-06-04 12:14:46 +02:00
Michael Schreckenbauer
5ef370c519 erase websocket::connection from vector in App::remove_websocket() 2022-06-03 07:44:57 +02:00
Vladislav Oleshko
b939dd4f1d Small fixes 2022-05-28 17:59:33 +03:00
Vladislav Oleshko
f46bdc1a24 First iteration of sessions 2022-05-28 16:42:25 +03:00
Michael Schreckenbauer
65fcdea968 allow setting userdata in onaccept of websocket-connection 2022-05-27 14:06:12 +02:00
Vladislav Oleshko
946292747e Small fixes 2022-05-23 20:17:49 +03:00
Vladislav
94fa9f77f6
Merge branch 'master' into app-constructor 2022-05-23 20:12:55 +03:00
Farook Al-Sammarraie
a6bf90fa8b
Merge branch 'master' into blueprint-middleware 2022-05-23 09:43:17 +03:00
The-EDev
cd67331fad
formatting 2022-05-21 14:51:48 +03:00
The-EDev
94a05b854a
changed functionality to avoid circular include 2022-05-21 12:32:32 +03:00
The-EDev
387c222ea2
added creating qs from request body functionality + updated doc 2022-05-20 22:36:32 +03:00
The-EDev
f2b63f23f5
Fix for issue where app.stop() blocks when a websocket is open 2022-05-20 14:14:55 +03:00
Farook Al-Sammarraie
3e6c097733
Merge branch 'master' into #421-Websockets-should-support-a-maximum-payload 2022-05-18 20:04:38 +03:00
konrad
7e4f57486c Add extra log when status code is not defined.
Just to document behaviour when returning status that is
not well-known.
2022-05-18 15:57:46 +03:00
The-EDev
5fcaa19163
should_close_ -> shutting_down_ 2022-05-18 14:08:40 +03:00
The-EDev
cfc4281e3b
Prevent acceptor from taking new connections while websockets close 2022-05-18 13:49:50 +03:00
Farook Al-Sammarraie
e7007cfbce
Merge branch 'master' into blueprint-middleware 2022-05-18 13:30:13 +03:00
The-EDev
4128e5c27d
further formatting 2022-05-18 12:40:11 +03:00
The-EDev
333b49bf04
Replaced do_not_destroy_ with adaptor_.shutdown_readwrite() +
formatting
2022-05-18 12:28:51 +03:00
The-EDev
57c3b43ac0
Fixed small bugs in code 2022-05-16 19:14:51 +03:00
oscar.chen
487c4e6c08 removing unneeded variable 2022-05-15 01:34:29 -07:00
oscar.chen
f0ea634c01 fix copy paste error 2022-05-15 01:21:34 -07:00
oscar.chen
a0a1925630 Pass the max payload in Connection constructor 2022-05-15 01:01:24 -07:00
oscar.chen
cdba76739f fix clang format 2022-05-14 19:35:45 -07:00
oscar.chen
7164517622 use arrow not . 2022-05-14 19:10:05 -07:00
oscar.chen
89d99f6ae9 add missing commas 2022-05-14 18:46:49 -07:00
oscar.chen
a30f0f6e4f fix wrong intializer syntax 2022-05-14 18:20:46 -07:00
oscar.chen
aa75fc108d fix wrong comment 2022-05-14 17:58:53 -07:00
oscar.chen
aaeaf9922e fix clang format 2022-05-14 17:54:21 -07:00
oscar.chen
4daf126df0 Add websocket payload size for both app and WebsocketRule 2022-05-14 17:51:51 -07:00
The-EDev
e5fe4e6e26
Used App reference to get websocket count and signals.
Also fixed issue where enabling SSL prevented compilation.
2022-05-15 01:15:39 +03:00
Farook Al-Sammarraie
9f99be55e1
Merge branch 'master' into ws_close 2022-05-14 18:56:39 +03:00
oscar.chen
dc988ce27b fix clang format 2022-05-14 14:07:51 +03:00
oscar.chen
182b1ba915 #421 add rudimentary support for websocket max payload 2022-05-14 14:07:51 +03:00
The-EDev
78c7186897 Allowed Crow class to be passed to Websocket connection object 2022-05-14 12:05:06 +03:00
Vladislav
4d4d0094fe
Merge branch 'master' into blueprint-middleware 2022-05-07 23:03:35 +03:00
Vladislav Oleshko
81ae1c9de2 Replace optional with empty string 2022-05-07 12:09:22 +03:00
Vladislav Oleshko
51bb6062ef Rename format, refactor dump 2022-05-07 12:09:22 +03:00
Vladislav Oleshko
a01e39cf5d Use std::tm instead of boost 2022-05-07 12:09:22 +03:00
Vladislav Oleshko
988926660e Support zero max-age for instant expiration 2022-05-07 12:09:22 +03:00
Vladislav Oleshko
76d7ae3dac Add attribute support to cookie parser 2022-05-07 12:09:22 +03:00
The-EDev
82e894dc88
formatting 2022-04-27 06:11:49 +03:00
The-EDev
84289dbe71
fix typos 2022-04-27 05:58:53 +03:00
The-EDev
2619f3a358
fixed issue where OPTIONS responses would report content-length 2022-04-27 05:55:31 +03:00
The-EDev
372212a3af
Added method for assigning an SSL certificate chain file 2022-04-27 05:54:33 +03:00
Joel Guittet
c14acad044 app: static can be an absolute path 2022-04-26 06:02:45 +03:00
Kinshuk Bairagi
de16aab1a9 Fix for cpp/comparison-with-wider-type 2022-04-26 05:30:31 +03:00
Farook Al-Sammarraie
b6a04058a1
Merge branch 'master' into gcc48 2022-04-25 09:34:52 +03:00
Dan Keenan
869a0abb04 Fix header name. 2022-04-21 19:51:22 -04:00
Dan Keenan
885ac41d99 Formatting fixes. 2022-04-20 16:26:09 -04:00
Dan Keenan
89226687ea Avoid exception handling. 2022-04-20 16:18:50 -04:00
Dan Keenan
33df7fc35b Handle extensions without mime types assigned to them. 2022-04-16 17:35:44 -04:00
Farook Al-Sammarraie
60b1d82999
Merge branch 'master' into gcc48 2022-04-16 16:07:05 +03:00
The-EDev
0f3721f5eb
removed mentions of is_callable in middleware.h 2022-04-16 16:05:41 +03:00
The-EDev
9f7ed83c45
Removed is_callable in favor of CallHelper + formatting 2022-04-16 16:04:49 +03:00
Vladislav Oleshko
74d94888d1 Generic app constructor 2022-04-13 20:49:22 +03:00
Vladislav Oleshko
d86b2d36f1 Add test, small fixes 2022-04-13 12:16:06 +03:00
Vladislav Oleshko
d9ba5787f1 Fix blueprint bug 2022-04-12 12:19:16 +03:00
Vladislav
cca8578556
Merge branch 'master' into blueprint-middleware 2022-04-12 10:52:45 +03:00
Dao-hui Chen
c2b8a60eb3 Concatenate log into one string and sending to std::cerr instead of multiple << operator 2022-04-12 09:18:38 +08:00
Vladislav Oleshko
eb2c0a58b2 Optimize dynamic call criteria, small fixes 2022-04-11 23:03:11 +03:00
Vladislav Oleshko
3b9e522523 Blueprint middleware prototype 2022-04-11 16:01:27 +03:00
The-EDev
facae48aa1
Allowed compiling on GCC 4.8 by using CallHelper instead of is_callable
Also fixed issue with ssl test string comparison (which caused random incorrect failures)
2022-04-11 06:24:43 +03:00
The-EDev
6a5c18a54f
Fixed issue where Crow wouldn't compile when using CROW_MIDDLEWARES with a pass-by-reference app 2022-04-09 04:45:32 +03:00
Farook Al-Sammarraie
57bf896ffd
Merge branch 'master' into cors-middleware-fix 2022-04-08 14:30:26 +03:00
Vladislav Oleshko
bccc03c141 Add inline decl to CORSRules helpers 2022-04-08 14:00:17 +03:00
The-EDev
0a739b35c6
fixed issue where SSL websockets wouldn't run due to HTTP upgrade 2022-04-07 15:54:50 +03:00
Farook Al-Sammarraie
6ffaf23375
Merge branch 'master' into crow-features 2022-04-04 21:44:11 +03:00
Luca Schlecker
44f51f4750 Crow's current features (ssl and compression) can now be enabled through 'CROW_FEATURES' instead of their own CMake variables.
The default features are the ones Crow was installed with but can be overridden by setting 'CROW_FEATURES' before the 'find_package' call.

Signed-off-by: Luca Schlecker <luca.schlecker@hotmail.com>
2022-04-04 20:36:57 +02:00
Farook Al-Sammarraie
912330322b
Merge branch 'master' into master 2022-04-04 21:19:18 +03:00
Darrell Wright
dcbb8a15fd
Update common.h
Fixed extra {
2022-04-04 13:04:26 -04:00
Harald Siegmund
d6d5e45399 make multipart robust against ill-formed body, prevents SIGSEGV 2022-04-04 17:55:19 +02:00
Harald Siegmund
7c285db88c make multipart robust against ill-formed body, prevents SIGSEGV 2022-04-04 17:27:53 +02:00
Darrell Wright
338b59f329
Split up operator""_method
When wrapping calls to crow from other code bases, I have had to call `operator""_method` explicitly.  Breaking it into two methods, `method_from_string` and `operator""_method` allows one to compose this code elsewhere.
2022-04-03 13:32:45 -04:00
The-EDev
5f18548369
Fixed problem where GCC < 6 wouldn't compile Crow 2022-03-30 15:50:11 +03:00
The-EDev
a3c1af4b29
updated documentation in mkdocs and doxygen 2022-03-24 01:55:46 +03:00
Farook Al-Sammarraie
c199fa08dc
removed test changes 2022-03-21 13:57:13 +03:00
Farook Al-Sammarraie
8185e0d0cc
Merge branch 'master' into lowercase_methods 2022-03-21 13:49:23 +03:00
The-EDev
be45925731
fixed issue where parser methods were in all caps 2022-03-21 13:47:46 +03:00
Kinshuk Bairagi
77e68e45b6
Support for CROW_USE_LOCALTIMEZONE
define CROW_USE_LOCALTIMEZONE macro for explict optin for localtimezone in logs
2022-03-20 23:52:35 +05:30
Kinshuk Bairagi
ee4ccf755a
Add http 504 codes 2022-03-20 23:23:07 +05:30
The-EDev
a0e6e3756b
added set_global_base method to change the default mustache templates
directory
2022-03-18 13:55:27 +03:00
The-EDev
69feb9c226
Formatting 2022-03-16 21:15:18 +03:00
The-EDev
c858078b4e
Fixed test porblem 2022-03-16 18:45:31 +03:00
Farook Al-Sammarraie
c4bcec1999
Merge branch 'master' into run_async 2022-03-11 10:59:12 +03:00
The-EDev
af81ca9034
removed redundant methods (i() and d()) 2022-03-11 10:30:59 +03:00
The-EDev
c0062bd2e7
added run_async method
also added unit tests for #358
2022-03-10 15:44:39 +03:00
Farook Al-Sammarraie
b02e1b1a73
Merge branch 'master' into multipart_improvements 2022-03-10 09:55:35 +03:00
The-EDev
8224854b1d
Improved how multipart messages work
part headers are now in a map rather than a vector
added `get_part_by_name()`
parts and headers can be cast to integer or double (returns the value)
added a boundary to the default content-type (gets set to the request's
boundary if constructed from a request)
2022-03-10 09:52:27 +03:00
Vladislav
870028ec99
Merge branch 'master' into cors-middleware 2022-03-08 16:53:12 +03:00
Vladislav Oleshko
1c4416ef8d Fixes. Complete builder pattern. Add testcase 2022-03-08 16:33:08 +03:00
The-EDev
37940d2cc0
fixed multiple definition problem and added test to make sure it doesn't
happen again
2022-02-23 06:00:00 +03:00
Vladislav Oleshko
6432d4486d Add example and test 2022-02-22 17:38:51 +03:00
The-EDev
ac0c756209
clear new parser variables 2022-02-21 17:32:09 +03:00
Vladislav Oleshko
13d62841df CORS Middleware 2022-02-20 22:43:24 +03:00
The-EDev
4650b5ecde
formatting 2022-02-18 04:31:28 +03:00
The-EDev
9a876e9451
Made template render() function return a returnable instead of a string
Justification is for the content-type header to be set to HTML instead of
text.

Also added render_string() functions to replace the old methods.
2022-02-18 04:25:02 +03:00