#include <cors.hpp>
Public Attributes | |
| std::vector< std::string > | origins = {} |
| std::vector< std::string > | headers = {} |
| std::vector< std::string > | exposedHeaders = {} |
| bool | credentials = false |
| std::optional< std::chrono::seconds > | maxAge = std::nullopt |
Cross-Origin Resource Sharing (CORS) options, set with Api::cors .
Allowed methods are not configured: they are the methods of the routes matching the request path (HEAD with GET , and OPTIONS ).
| bool anch::rest::CorsOptions::credentials = false |
Allow credentials (cookies, Authorization ): Access-Control-Allow-Credentials: true . It can not be used with the "*" origin.
| std::vector<std::string> anch::rest::CorsOptions::exposedHeaders = {} |
Response headers exposed to the browser ( Access-Control-Expose-Headers )
| std::vector<std::string> anch::rest::CorsOptions::headers = {} |
Allowed request headers (case insensitive), checked on preflight requests. "*" allows every requested header.
| std::optional<std::chrono::seconds> anch::rest::CorsOptions::maxAge = std::nullopt |
Preflight response cache duration ( Access-Control-Max-Age ), not sent when empty
| std::vector<std::string> anch::rest::CorsOptions::origins = {} |
Allowed origins (scheme://host[:port] ), compared exactly. "*" allows every origin. It can not be empty.