mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Merge branch 'master' into feature/fix-websocket-route-macro
This commit is contained in:
commit
c1c707371c
@ -62,6 +62,8 @@ target_link_libraries(Crow
|
||||
asio::asio
|
||||
)
|
||||
|
||||
target_compile_definitions(Crow INTERFACE "")
|
||||
|
||||
if("compression" IN_LIST CROW_FEATURES)
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(Crow INTERFACE ZLIB::ZLIB)
|
||||
|
@ -305,7 +305,7 @@ namespace crow
|
||||
if (static_dir_[static_dir_.length() - 1] != '/')
|
||||
static_dir_ += '/';
|
||||
|
||||
bp->new_rule_tagged<crow::black_magic::get_parameter_tag(CROW_STATIC_ENDPOINT)>(CROW_STATIC_ENDPOINT)([bp, static_dir_](crow::response& res, std::string file_path_partial) {
|
||||
bp->new_rule_tagged<crow::black_magic::get_parameter_tag(CROW_STATIC_ENDPOINT)>(CROW_STATIC_ENDPOINT)([static_dir_](crow::response& res, std::string file_path_partial) {
|
||||
utility::sanitize_filename(file_path_partial);
|
||||
res.set_static_file_info_unsafe(static_dir_ + file_path_partial);
|
||||
res.end();
|
||||
|
@ -139,7 +139,7 @@ namespace crow
|
||||
set_header("Content-Type", value.content_type);
|
||||
}
|
||||
response(int code, returnable&& value):
|
||||
code(code), body(std::move(value.dump()))
|
||||
code(code), body(value.dump())
|
||||
{
|
||||
set_header("Content-Type", std::move(value.content_type));
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ namespace crow
|
||||
}
|
||||
|
||||
private:
|
||||
friend class CookieParser;
|
||||
friend struct CookieParser;
|
||||
std::vector<Cookie> cookies_to_add;
|
||||
};
|
||||
|
||||
|
@ -335,7 +335,7 @@ namespace crow
|
||||
}
|
||||
|
||||
private:
|
||||
friend class SessionMiddleware;
|
||||
friend struct SessionMiddleware;
|
||||
|
||||
void check_node()
|
||||
{
|
||||
|
@ -755,7 +755,8 @@ namespace crow
|
||||
return;
|
||||
if (node.IsSimpleNode())
|
||||
{
|
||||
auto& child_temp = node.children[0];
|
||||
auto children_temp = std::move(node.children);
|
||||
auto& child_temp = children_temp[0];
|
||||
node.key += child_temp.key;
|
||||
node.rule_index = child_temp.rule_index;
|
||||
node.blueprint_index = child_temp.blueprint_index;
|
||||
|
@ -88,7 +88,7 @@ namespace crow
|
||||
{
|
||||
if (!utility::string_equals(req.get_header_value("upgrade"), "websocket"))
|
||||
{
|
||||
adaptor.close();
|
||||
adaptor_.close();
|
||||
handler_->remove_websocket(this);
|
||||
delete this;
|
||||
return;
|
||||
@ -99,7 +99,7 @@ namespace crow
|
||||
void* ud = nullptr;
|
||||
if (!accept_handler_(req, &ud))
|
||||
{
|
||||
adaptor.close();
|
||||
adaptor_.close();
|
||||
handler_->remove_websocket(this);
|
||||
delete this;
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user