15 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 HttpRequest.hpp:19
routing::Middleware require_origin(std::vector< std::string > allowed_origins)
Rejects browser requests from origins that are not listed.
std::function< bool(http::HttpRequest &, std::shared_ptr< http::ResponseWriter >)> Middleware
Definition Router.hpp:19
Options for configuring CORS (Cross-Origin Resource Sharing).
Definition Cors.hpp:13
int max_age
Definition Cors.hpp:18
std::vector< std::string > allowed_origins
Definition Cors.hpp:14
std::vector< std::string > allowed_methods
Definition Cors.hpp:15
std::vector< std::string > allowed_headers
Definition Cors.hpp:16
bool allow_credentials
Definition Cors.hpp:17