Skip to content
Download

allowHeaders

mach::CorsBuilder::allowHeaders

Allows multiple headers.

Allows requests using the specified HTTP headers.

CorsBuilder& allowHeaders(std::initializer_list<std::string_view> headers);

A reference to the current CorsBuilder instance.

Parameter Description
headers The headers to allow.

This method may be called multiple times to add additional headers.

This method is not thread-safe and should only be called during CORS configuration.

cors.allowHeaders({
"Content-Type",
"Authorization"
});
Name Description
allowHeader Allows the specified header.