allowHeaders
mach::CorsBuilder::allowHeaders
Allows multiple headers.
Description
Section titled “Description”Allows requests using the specified HTTP headers.
Syntax
Section titled “Syntax”CorsBuilder& allowHeaders(std::initializer_list<std::string_view> headers);Return Value
Section titled “Return Value”A reference to the current CorsBuilder instance.
Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
headers |
The headers to allow. |
Remarks
Section titled “Remarks”This method may be called multiple times to add additional headers.
Thread Safety
Section titled “Thread Safety”This method is not thread-safe and should only be called during CORS configuration.
Example
Section titled “Example”cors.allowHeaders({ "Content-Type", "Authorization"});See Also
Section titled “See Also”| Name | Description |
|---|---|
allowHeader |
Allows the specified header. |