roar
Loading...
Searching...
No Matches
Public Attributes | List of all members
Roar::CorsSettings Struct Reference

Settings object to control CORS requests. More...

#include <cors.hpp>

Collaboration diagram for Roar::CorsSettings:

Public Attributes

std::function< std::string(std::string const &)> allowedOrigin
 Access-Control-Allow-Origin.
 
std::function< std::vector< std::string >(std::vector< std::string > const &)> methodAllowSelection
 Access-Control-Allow-Methods.
 
std::function< std::vector< std::string >(std::vector< std::string > const &)> headerAllowSelection
 Access-Control-Allow-Headers.
 
std::vector< boost::beast::http::field > exposeHeaders {}
 Access-Control-Expose-Headers, will not be set if empty.
 
std::optional< bool > allowCredentials {std::nullopt}
 Access-Control-Allow-Credentials.
 
bool generatePreflightOptionsRoute = true
 Generate an OPTIONS route for preflights?
 

Detailed Description

Settings object to control CORS requests.

Member Data Documentation

◆ allowCredentials

std::optional<bool> Roar::CorsSettings::allowCredentials {std::nullopt}

Access-Control-Allow-Credentials.

◆ allowedOrigin

std::function<std::string(std::string const&)> Roar::CorsSettings::allowedOrigin
Initial value:
{[](std::string const& origin) {
return origin.empty() ? std::string("*") : origin;
}}

Access-Control-Allow-Origin.

◆ exposeHeaders

std::vector<boost::beast::http::field> Roar::CorsSettings::exposeHeaders {}

Access-Control-Expose-Headers, will not be set if empty.

◆ generatePreflightOptionsRoute

bool Roar::CorsSettings::generatePreflightOptionsRoute = true

Generate an OPTIONS route for preflights?

◆ headerAllowSelection

std::function<std::vector<std::string>(std::vector<std::string> const&)> Roar::CorsSettings::headerAllowSelection
Initial value:
{
[](std::vector<std::string> const& requestedHeaders) {
return requestedHeaders;
}}

Access-Control-Allow-Headers.

◆ methodAllowSelection

std::function<std::vector<std::string>(std::vector<std::string> const&)> Roar::CorsSettings::methodAllowSelection
Initial value:
{
[](std::vector<std::string> const& requestedMethods) {
return requestedMethods;
}}

Access-Control-Allow-Methods.


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