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