CORSHandler is a global middleware for setting CORS headers. More...
Classes | |
struct | context |
Public Member Functions | |
void | before_handle (crow::request &, crow::response &, context &) |
void | after_handle (crow::request &req, crow::response &res, context &) |
CORSRules & | prefix (const std::string &prefix) |
Handle CORS on a specific prefix path. More... | |
CORSRules & | blueprint (const Blueprint &bp) |
Handle CORS for a specific blueprint. More... | |
CORSRules & | global () |
Get the global CORS policy. More... | |
Private Member Functions | |
CORSRules & | find_rule (const std::string &path) |
Private Attributes | |
std::vector< std::pair< std::string, CORSRules > > | rules |
CORSRules | default_ = CORSRules(this) |
CORSHandler is a global middleware for setting CORS headers.
By default, it sets Access-Control-Allow-Origin/Methods/Headers to "*". The default behaviour can be changed with the global()
cors rule. Additional rules for prexies can be added with prefix()
.
|
inline |
|
inline |
|
inline |
Handle CORS on a specific prefix path.
Handle CORS for a specific blueprint.
|
inline |
Get the global CORS policy.
|
inlineprivate |
|
private |