Commit Graph

67 Commits

Author SHA1 Message Date
The-EDev
576690bf14 Made catchall work with 404 or 405 errors
snuck in a fix for release.py where version name wouldn't change
also snuck in slight improvement in finding blueprint (removed extra if statement)
2021-08-21 04:49:17 +03:00
The-EDev
f5338260bb several changes:
added json list in a similar fashion to json object
renamed object_type to object
updated readme, index.html, and json.md to include objects and lists
updated examples to be slightly cleaner and include lists
replaced instances of json object (std::map and such) with the short version (object)
accurate floating point number dumping (`6.0` instead of `6`) while taking 1/30th of the time (29 microseconds saved)
added json list testing
snuck in utf-8 middleware warning fix
snuck in twitter card style for crowcpp.org site (makes social media cards look way better with a large image)
2021-08-20 03:57:21 +03:00
Lucas David
6ae3025bd6 - Removed useless comments. 2021-08-12 09:31:27 +02:00
Lucas David
235f2b9ef4 + Added (implicit) constructors for json "supported" types.
+ added corresponding tests.
+ Added json-map examples.
2021-08-09 14:32:51 +02:00
Lucas David
762af68306 + Added object constructor and assignment for json::wvalue and unit tests.
+ json::wvalue::wvalue(std::initializer_list<std::pair<std::string const, json::wvalue>>
  + json::wvalue::wvalue(std::[unordered_]map<std::string, json::wvalue> const&)
  + json::wvalue::wvalue(std::[unordered_]map<std::string, json::wvalue>&&)
  + json::wvalue::operator=(std::initializer_list<std::pair<std::string const, json::wvalue>>)
  + json::wvalue::operator=(std::[unordered_]map<std::string, json::wvalue> const&)
  + json::wvalue::operator=(std::[unordered_]map<std::string, json::wvalue>&&)
2021-08-09 14:32:51 +02:00
The-EDev
e713ad54cb added unit test, moved macros to app.h, and fixed bug where "bp_prefix2" would be considered a child of "bp_prefix" even if it's not 2021-07-28 22:31:08 +03:00
The-EDev
ca31b85156 added CROW_ENABLE_COMPRESSION macro to enable zlib compression
This makes zlib dependency (which is quite problematic) optional
2021-06-03 17:12:20 +03:00
The-EDev
f39b9ddce7 Quality of life improvements
Added pop() method to query_string, same as get(), but removes the item from the querystring
Added std::string() operator to json::rvalue (allows std::string(json["abc"]), which returns any value that isn't a container to string)
Added lo() method to json::rvalue, returns a vector of json::rvalue containing whatever a json object or list has (difference being a list has no keys)
Added keys() method to json::rvalue, returns a vector of std::string containing the keys of a json object
Made json::wvalue use either std::map or std::unordered_map instead of just std::unordered_map
Added copy constructor to json::wvalue
Added size() method to json::wvalue, returns 1 or the size of the json list.
Added constructor to create json::wvalue from std::vector
Added keys() method to query_string
Documented query_string and improved json doc
Made tests and examples for all the additions
2021-05-12 15:45:55 +03:00
The-EDev
f779a0f8a4 changed catchall to fit with the rest of crow
the macro is similar to CROW_ROUTE, added example to cmake, added unit test, and documentation
2021-04-12 08:25:09 +03:00
Farook Al-Sammarraie
1654acbfd0
Merge branch 'master' into HEAD_and_OPTIONS 2021-04-03 06:31:45 +03:00
The-EDev
ec566f87ef added tests and fixed small issues
moved body handling to Response.end() and fixed a bug where a 404 was not returned on a route that doesn't exist
2021-04-03 06:00:23 +03:00
Maxim Kokryashkin
cdce8f443a macro rename 2021-03-31 20:30:32 +03:00
Maxim Kokryashkin
ce7d08eb0e fixed issues with static wariables 2021-02-21 00:28:32 +03:00
The-EDev
747ad6db72 Merge branch 'master' 2021-01-21 21:37:55 +03:00
The-EDev
33f1206571 made json a returnable type and removed json specific code 2021-01-05 17:49:10 +03:00
The-EDev
09d0f4ccdd Added HTTP compression using gzip or deflate (disabled by default, requires calling method) 2021-01-02 22:12:04 +03:00
The-EDev
384baaade4 moved middlewares folder inside crow folder
also fixed an issue where by default nothing is included
2020-11-11 23:43:57 +03:00
The-EDev
5d23b2b9c7 fixed testing issue 2020-11-11 13:51:29 +03:00
The-EDev
76af416766 added websocket unit test 2020-11-09 04:47:41 +03:00
The-EDev
3d88042161 revamped stream tests (body streaming should work properly now) 2020-10-31 03:05:24 +03:00
The-EDev
97bb487d85 stream test changes
test now runs on separate thread from app (to allow the app to write to the socket before the test reads it)
changed value to test agains (since the value I'm testing on is actually the end 305th instance, not the start of the 306th)
2020-10-27 22:53:58 +03:00
The-EDev
4f7411d1aa replaced REQUIRE with CHECK
check allows the code to keep running if the check fails, allowing code like app.stop() to execute, which is needed to finalize some tests
2020-10-27 02:43:36 +03:00
The-EDev
be7fc743c9 changed test sections order for sendfile test 2020-10-27 02:41:29 +03:00
The-EDev
5a8c12a9ff changed response streaming test to test the actual data being sent over the socket 2020-10-27 02:39:20 +03:00
Farook Al-Sammarraie
019ead45e2
Merge branch 'master' into stream_body 2020-10-21 19:50:01 +03:00
The-EDev
bcd135fad6 set connection to stream any respose body larger than 1MB
using the same system for static file serving
2020-10-21 04:02:09 +03:00
Farook Al-Sammarraie
7fa73907f8
removed main function 2020-10-20 10:21:29 +03:00
Farook Al-Sammarraie
65b12e88e8
Merge branch 'master' into multipart 2020-10-20 10:10:52 +03:00
Igor Mróz
ba5f62a512
Enable debug in tests. 2020-10-20 08:23:40 +02:00
Igor Mróz
d33f04c7e7
CMakeLists small changes. Add clang-format config. Remove Makefile. 2020-10-19 18:32:16 +02:00
Igor Mróz
7b8b72bd11
Remove conanfile. Update mustache specification jsons. Remove compilation warnings. Update CMake version. Change test framework to Catch2. 2020-10-19 18:32:16 +02:00
The-EDev
e06942dfc4 added test
funny enough, the test pointed out a mistake i made in the code XD
2020-10-18 02:36:39 +03:00
The-EDev
88904e4716 added test for 405 code on wrong method 2020-10-15 01:24:26 +03:00
The-EDev
43b465a9ad automated copying cat.jpg file
tests can now run without a problem
2020-10-13 11:04:46 +03:00
The-EDev
3a22fd5199 added sendfile test
Test cannot actually test whether the file was sent or not since the test has no access to the socket itself (also idk how to get data that was passed through a socket)
2020-10-13 00:52:15 +03:00
ipknHama
b7360a2bac Support multiple methods for same URL
- fix broken unittests because of server initializing order change
 - add a function to wait until server is up
2017-12-25 15:31:20 +09:00
ipknHama
daa1e3eadc Add PURGE method, add a special enum item for counting 2017-12-25 15:31:20 +09:00
Erik Åldstedt Sund
ecbbd0ebf2 Fixed ostream operator for big integers 2017-10-30 20:47:48 +01:00
Erik Åldstedt Sund
4fe7dd171a Handle big integers in json::wvalue
Handled by adding an enum num_type in both rvalue and wvalue (to separate
between signed/unsigned ints, and floating point values) and a union for
the number value in wvalue.
2017-10-30 20:47:48 +01:00
BooD
8b01385465 Add HTTP PATCH support 2017-10-05 18:13:40 +03:00
ipknHama
e93ba25f2c Fix cookie parsing: Cookie doesn't have escaping mechanism. 2017-09-18 02:39:46 +09:00
ipknHama
3081e4e1a8 Cleanup include folder into crow subfolder
- only crow.h is exposed now
2016-09-21 23:11:06 +09:00
Jaeseung Ha
e9d41a6373 Remove warnings 2016-09-06 09:40:30 +09:00
ipknHama
f88b56dff0 Add u() for uint64_t: manually applying #129 2016-08-27 18:12:17 +09:00
ipknHama
e161da45e0 Remove warnings: manually applying #101, #104 2016-08-27 18:03:49 +09:00
Gino Maisto
1b1210685e Bind to interface support: fixed unittest 2016-03-19 16:05:48 +01:00
Chao Mai
4b858c2073 change to std::move 2015-07-12 02:07:47 +08:00
Chao Mai
36c90f4401 fix build problem 2015-07-12 00:43:48 +08:00
Bryce Anderson
243995f36f Fix memory error and invalid param when no params are present
Also added a unit test that fails with the previous behavior.
Note that `-fsanitize=address` exposes the invalid memory access in
qs_parse.
2015-04-30 20:56:28 -04:00
ipknHama
5d8d527639 add run-time check for handler type for route_dynamic 2015-02-19 12:16:28 +09:00