Merge branch 'master' into feature/fix-websocket-route-macro

This commit is contained in:
Farook Al-Sammarraie 2022-12-10 13:35:12 +03:00 committed by GitHub
commit c1c707371c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 7 deletions

View File

@ -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)

View File

@ -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();

View File

@ -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));
}

View File

@ -225,7 +225,7 @@ namespace crow
}
private:
friend class CookieParser;
friend struct CookieParser;
std::vector<Cookie> cookies_to_add;
};

View File

@ -335,7 +335,7 @@ namespace crow
}
private:
friend class SessionMiddleware;
friend struct SessionMiddleware;
void check_node()
{

View File

@ -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;

View File

@ -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;