allowOrigins
mach::CorsBuilder::allowOrigin
Allows multiple origins.
Description
Section titled “Description”Allows requests originating from the specified origins.
Syntax
Section titled “Syntax”CorsBuilder& allowOrigins(std::initializer_list<std::string_view> origins);Return Value
Section titled “Return Value”A reference to the current CorsBuilder instance.
Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
origins |
The origins to allow. |
Remarks
Section titled “Remarks”This method may be called multiple times to add additional origins.
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.allowOrigins({ "https://example.com", "https://api.example.com"});See Also
Section titled “See Also”| Name | Description |
|---|---|
allowOrigin |
Allows the specified origin. |