Commit Graph

1463 Commits

Author SHA1 Message Date
Igor Mróz
4eda8bdcd0
Merge pull request #566 from hlmodi/fix-381
Fix 381
2022-11-30 10:23:03 +01:00
Lionel Modi
75d6f22142 Fix 381 2022-11-30 09:48:43 +01:00
Igor Mróz
fc87b47ec8
Merge pull request #565 from BoleynSu/patch-1
Fix use-after-move
2022-11-30 09:44:39 +01:00
Boleyn Su
73c543a007 Fix use-after-move 2022-11-30 09:18:21 +01:00
Igor Mróz
dedfd639c3
Merge pull request #561 from okaestne/clang-warnings
Fix warnings generated by clang++
2022-11-30 09:13:37 +01:00
Simon Oehrl
d0929ae66d Fix formatting 2022-11-23 13:37:34 +01:00
Simon Oehrl
8b34504741 Use const string reference instead of string_view 2022-11-23 13:37:34 +01:00
Simon Oehrl
cec165e29a Adapt CROW_WEBSOCKET_ROUTE to accept app reference 2022-11-23 13:37:34 +01:00
okaestne
5e19641d61 fix friend declarations 2022-11-08 10:32:37 +01:00
okaestne
9e7015281e http_response: don't try to move temporary 2022-11-08 10:32:37 +01:00
okaestne
2970f81001 app: remove unused lambda caption 2022-11-08 10:32:37 +01:00
Igor Mróz
84ec7832b0
Merge pull request #560 from okaestne/fix-memleaks
Fix some valgrind reported issues
2022-11-08 09:05:05 +01:00
okaestne
5543276c4e
http_connection: initialize task_id_ 2022-11-05 23:08:54 +01:00
okaestne
323a7cb48f
routing: use object references instead of raw pointers
this fixes some memory leaks.
also remove unused `get_size` method.
2022-11-05 23:08:49 +01:00
Farook Al-Sammarraie
71bc4445f9
Merge pull request #553 from okaestne/debian-pkg
feat(cmake): improved debian packaging
2022-11-04 18:58:45 +03:00
okaestne
59a0e82fed feat(cmake): improved debian packaging
Improve Debian package generated by cmake's CPack:
* set architecture to `all`, making the .deb installable
  and thus Crow usable on other system archtectures like arm
* add `libasio-dev` as dependency (fixes #420)
* set section to `libdevel`
* disabled shlibdeps (not needed here)
2022-11-04 01:29:48 +03:00
The-EDev
3994bf293c
docs redirect potential fix 2022-11-03 11:42:36 +03:00
The-EDev
5d50db7773
replaced github-square with square-github 2022-11-03 11:27:30 +03:00
Igor Mróz
e3ba10df18
Merge pull request #550 from lag945/examples_patch_20221021
Change one of example's routes to handle POST instead of GET.
2022-10-29 23:21:47 +02:00
Laguna Du
1681ff2d2d Fix code formatting again. 2022-10-27 16:05:51 +08:00
Laguna Du
628361b6f7 Fix code formatting. 2022-10-27 15:55:36 +08:00
Laguna Du
befdcd34de fix post method. 2022-10-21 16:08:38 +08:00
Seungwoo Kang
ac757ff0c9
Fix websocket crash from connection pointer dangling (#530)
* websocket: Add dangling-prevent anchor pointer

* websocket: Fix deadlock from incorrect expiration expectation

* webscoket: Fix unsafe write access to anchor_

* websocket: Fix build error from use of 'nullptr_t'

* websocket: Remove latent dereferencing on dangling 'this' pointer

* websocket: Resolve conflict with master branch

Co-authored-by: Vladislav <vladislav.oleshko@gmail.com>
2022-10-09 19:03:52 +03:00
Ryan Russell
f5adec7803
refactor(websocket): readability improvements (#541)
Signed-off-by: Ryan Russell <git@ryanrussell.org>
Co-authored-by: Vladislav <vladislav.oleshko@gmail.com>
2022-09-19 00:34:43 +03:00
Seungwoo Kang
1e47bc67ba
websocket: Reduce number of re-allocation of string parameters (#535)
Co-authored-by: Vladislav <vladislav.oleshko@gmail.com>
2022-09-18 23:57:37 +03:00
Ryan Russell
33becfb353
docs(middlewares): readability improvements (#540)
Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-09-18 23:24:29 +03:00
Jake Arkinstall
0b90bb486c
Address #534 - handling missing mime types gracefully (#536)
* Added tests for content-type to mime-type detection.

Added a custom_content_types test case that verifies that a user can
specify the mime-type through the contentType parameter upon creation
of a response. If their contentType does not appear in the mime_types
map, but looks like a valid mime type already, it should be used as the
mime type.

Validating against the full list of valid mime types
(https://www.iana.org/assignments/media-types/media-types.xhtml)
would be too intensive, so we merely verify that the parent type
(application, audio, font, text, image, etc) is a valid RFC6838
type, and that the subtype is at least one character. Thus we can
verify that custom/type fails, and incomplete strings such as
image/ and /json fail.
2022-09-12 14:16:16 +03:00
Farook Al-Sammarraie
c0bfaa7709
Merge pull request #523 from CrowCpp/fix-stack-data-disclosure
Fix stack data disclosure when returning static files smaller than 16KiB
2022-08-23 00:22:33 +03:00
Farook Al-Sammarraie
27439944b0
Merge branch 'master' into fix-stack-data-disclosure 2022-08-23 00:22:17 +03:00
Farook Al-Sammarraie
6227114191
Merge pull request #524 from CrowCpp/prevent_pipeline
Prevent HTTP pipelining
2022-08-23 00:21:59 +03:00
The-EDev
1e0efb0b8b
Added unittest for Host header 2022-08-22 22:32:22 +03:00
Igor Mróz
d17a88af69
Fix stack data disclosure when returning static files smaller than
16KiB. It could also cause to return partially incorrect file ending in
case of file not being rounded up to 16KiB.

Thanks to Gynvael Coldwind and hebi for discovering and preparing
report.
2022-08-22 20:15:03 +02:00
The-EDev
0aa3ab94be
fixed unit-tests and warnings 2022-08-22 00:38:03 +03:00
The-EDev
fba01dc76d
Prevent HTTP pipelining which Crow doesn't support. 2022-08-21 21:33:04 +03:00
Farook Al-Sammarraie
fde74c4d2e
Merge pull request #522 from ryanrussell/vcpkg-reference-fix
docs(compression): Fix `vcpkg.json` reference
2022-08-20 17:17:59 +03:00
Ryan Russell
66f1a9e948 docs(compression): Fix vcpkg.json reference
Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-08-20 09:15:59 -05:00
Vladislav
df0b50ba79
Merge pull request #518 from deroskarmodulo/master
Fix merge_all.py to use encoding='UTF-8' in open() calls
2022-08-15 20:36:46 +03:00
Oskar Schmölz
5642509eae add utf-8 encoding for file opening 2022-08-12 13:58:21 +02:00
Farook Al-Sammarraie
87cf68f0eb
Merge pull request #514 from erikaldsund/cpp17_filesystem_usage_fixes
Cpp17 filesystem usage fixes
2022-08-07 19:01:47 +03:00
erik
b12767133a Don't use std::filesystem when compiling in C++17 mode on gcc < 8
On gcc < 8, filesystem had to be included as <experimental/filesystem>, it
was also living in the std::experimental namespace, and also required the user
to link against -lstdc++fs.
2022-08-06 00:59:57 +03:00
erik
99c4569408 Fix compilation error using std::filesystem::path
A std::filesystem::path is not implicitly convertible to a std::string.
2022-08-06 00:59:57 +03:00
Farook Al-Sammarraie
6e7f0fb8e6
Merge pull request #513 from erikaldsund/cpp11_ambiguity_fix
Fix compilation error: ambiguous overload
2022-08-05 18:41:01 +03:00
erik
e3f5c5924c Fix compilation error: ambiguous overload
On gcc 5.3.0, you get a compilation error when assigning a lambda
function to a json::wvalue. The compilation error is due to a lambda
function being implicitly convertible to a function pointer, which again
can be implicitly converted to both a bool and a std::function. Avoid
the ambiguity by explicitly casting the lambda to a std::function.
2022-08-05 15:52:52 +02:00
Farook Al-Sammarraie
c4e810f645
Merge pull request #507 from CrowCpp/optional_static_dir_slash
static directory slash fix
2022-07-25 14:29:46 +03:00
Farook Al-Sammarraie
4e4dbec120 formatting 2022-07-25 13:56:54 +03:00
The-EDev
5f22a6562a made CROW_STATIC_DIRECTORY and BP static directory more versatile (on
win and linux)
2022-07-25 13:56:54 +03:00
Farook Al-Sammarraie
04808b8557
Merge pull request #508 from dranikpg/middleware-macro-fix
Add template/typename keywords to crow macros
2022-07-24 15:45:05 +03:00
Vladislav Oleshko
34d8bd34bc Add template keyword to CROW_MIDDLEWARES 2022-07-24 00:31:34 +03:00
Farook Al-Sammarraie
ac7fb15e7e
Merge pull request #499 from CrowCpp/early_routing
Find the route as soon as the URL is parsed
2022-07-22 18:13:45 +03:00
The-EDev
25eefa1711 Addressed code reviews + small tweaks (unit test and paser.done()) 2022-07-22 17:17:38 +03:00