Merge branch 'master' into cors-middleware

This commit is contained in:
Vladislav 2022-03-08 16:53:12 +03:00 committed by GitHub
commit 870028ec99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 2 deletions

View File

@ -107,7 +107,7 @@ namespace crow
// should not add an item below this line: used for array count
};
const char* method_strings[] =
constexpr const char* method_strings[] =
{
"DELETE",
"GET",

View File

@ -130,12 +130,17 @@ namespace crow
{
url.clear();
raw_url.clear();
header_building_state = 0;
header_field.clear();
header_value.clear();
headers.clear();
url_params.clear();
body.clear();
header_building_state = 0;
qs_point = 0;
http_major = 0;
http_minor = 0;
keep_alive = false;
close_connection = false;
}
inline void process_header()

View File

@ -17,6 +17,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
endif()
add_subdirectory(template)
add_subdirectory(multi_file)
if (CROW_ENABLE_SSL)
add_subdirectory(ssl)
endif()

View File

@ -0,0 +1,6 @@
project(test_multi_file)
file (GLOB_RECURSE SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
add_executable(${PROJECT_NAME} ${SRC})
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${PROJECT_NAME} PUBLIC Crow::Crow)

15
tests/multi_file/main.cpp Normal file
View File

@ -0,0 +1,15 @@
// Test of a project containing more than 1 source file which includes Crow headers.
// The test succeeds if the project is linked successfully.
#include "crow.h"
int main()
{
crow::SimpleApp app;
CROW_ROUTE(app, "/")
([]() {
return "Hello, world!";
});
app.port(18080).run();
}

View File

@ -0,0 +1 @@
#include <crow.h>