Commit Graph

140 Commits

Author SHA1 Message Date
Vladislav Oleshko
bd4f7cc847 Add small unittest 2022-06-25 17:16:42 +03:00
Luca Schlecker
d3e19a53ab add initial unittests for utility::string_equals and utility::lexical_cast. 2022-06-18 17:21:37 +03:00
Luca Schlecker
2fbf93e211 replace std::error_code with asio::error_code.
This makes the code more consistent and also reflects the intention a little better.
2022-06-18 17:21:37 +03:00
Luca Schlecker
982e62eabf utility: add string trimming function. 2022-06-18 17:21:37 +03:00
Luca Schlecker
5b1c5a9e9e removing some boost includes, fixing version checks and further phase out boost. 2022-06-18 17:21:37 +03:00
Luca Schlecker
df92d6d639 replace boost::lexical_cast with an equivalent based on std::stringstream. 2022-06-18 17:21:37 +03:00
Luca Schlecker
f3d00bbecf replace boost::asio with standalone asio. 2022-06-18 17:21:37 +03:00
Luca Schlecker
78f764791e remove 'using namespace boost' declarations. 2022-06-18 17:21:37 +03:00
erik
3fe1ee062a Fixed base64 test to not depend on terminating null-characters in binary strings
std::strings with binary data should always be created with the constructor
taking a char pointer and the length of the character data.
2022-06-13 09:27:30 +02:00
erik
f7758feab5 Make stream_response test independent of header size
The test was failing when built using my mingw64-11.2.0 toolset on the Windows
platform, on the 1.0+3 release.
2022-06-13 09:24:33 +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
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
The-EDev
564b070d5f Made test port static and replaced REQUIRE with CHECK and if
Using port 0 seems to cause the test to be blocked
Also added methods and status codes to Crow's documentation
2022-05-18 15:57:46 +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
Farook Al-Sammarraie
e7007cfbce
Merge branch 'master' into blueprint-middleware 2022-05-18 13:30:13 +03:00
The-EDev
94a0c3555a
formatting 2022-05-16 19:32:33 +03:00
The-EDev
0f6bfb04ee
added documentation and unit test 2022-05-16 19:15:34 +03:00
The-EDev
c7001f81fc Removed test print 2022-05-14 12:05:06 +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
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
e15675f74e Add cookie formatting tests 2022-05-07 12:09:22 +03:00
Dan Keenan
bdfd9cb6a9 Create failing test. 2022-04-16 17:31:12 -04: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
3b9e522523 Blueprint middleware prototype 2022-04-11 16:01: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
The-EDev
c0062bd2e7
added run_async method
also added unit tests for #358
2022-03-10 15:44:39 +03:00
Vladislav Oleshko
1c4416ef8d Fixes. Complete builder pattern. Add testcase 2022-03-08 16:33:08 +03:00
Vladislav Oleshko
5f105aca37 Fix clang-format 2022-02-22 17:46:29 +03:00
Vladislav Oleshko
6432d4486d Add example and test 2022-02-22 17:38:51 +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
Farook Al-Sammarraie
9db0e3b8fe
Merge branch 'master' into parser_optimization 2022-02-15 15:56:48 +03:00
Farook Al-Sammarraie
1c98bbb860
Merge branch 'master' into local-middleware 2022-02-14 22:17:19 +03:00
Farook Al-Sammarraie
ab50fb3134
Merge branch 'master' into parser_optimization 2022-02-11 00:46:19 +03:00
Vladislav Oleshko
a5ba69f5a4 Update test for completion handler fix 2022-02-08 21:57:39 +03:00
The-EDev
155cf759eb
fixed issue where absolute unix paths were not sanitized 2022-02-08 19:11:46 +03: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
Vladislav Oleshko
69e9ad9c1e Run clang format 2022-02-01 23:21:07 +03:00
Vladislav Oleshko
e60714c0b2 Separate middleware for handlers 2022-02-01 22:49:41 +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
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