14 std::vector<std::string>
allowed_methods = {
"GET",
"POST",
"PUT",
"PATCH",
"DELETE",
"OPTIONS"};
routing::Middleware cors(CorsOptions options=CorsOptions{})
Returns a middleware that handles CORS.
Definition Cors.cpp:18
Definition Compress.hpp:4
std::function< bool(http::HttpRequest &, std::shared_ptr< http::ResponseWriter >)> Middleware
Definition Router.hpp:17
Options for configuring CORS (Cross-Origin Resource Sharing).
Definition Cors.hpp:12
std::vector< std::string > allowed_methods
Definition Cors.hpp:14
bool allow_credentials
Definition Cors.hpp:16
std::vector< std::string > allowed_origins
Definition Cors.hpp:13
std::vector< std::string > allowed_headers
Definition Cors.hpp:15
int max_age
Definition Cors.hpp:17