Module cors

Source

Structs§

CorsConfig
This is the configuration that the CORS handler will follow. Its default configuration is basically not to touch any responses, resulting in the browser’s default behaviour.

Enums§

Headers
Specify the allowed headers of the request. It is up to the browser to check that only the allowed headers are sent with the request.
Origin
Specify the allowed origins of the request. It is up to the browser to check the validity of the origin. This, when sent to the browser, will indicate whether or not the request’s origin was allowed to make the request.

Traits§

CorsRoute
Add CORS routing for your path. This is required for handling preflight requests.

Functions§

handle_cors
Handle CORS for a non-preflight request. This means manipulating the res HTTP headers so that the response is aligned with the state’s CorsConfig.