Crow  1.1
A C++ microframework for the web
crow::CORSHandler Struct Reference

CORSHandler is a global middleware for setting CORS headers. More...

#include <cors.h>

Classes

struct  context
 

Public Member Functions

void before_handle (crow::request &, crow::response &, context &)
 
void after_handle (crow::request &req, crow::response &res, context &)
 
CORSRulesprefix (const std::string &prefix)
 Handle CORS on a specific prefix path.
 
CORSRulesblueprint (const Blueprint &bp)
 Handle CORS for a specific blueprint.
 
CORSRulesglobal ()
 Get the global CORS policy.
 

Detailed Description

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().


The documentation for this struct was generated from the following file: