allowCredentials
mach::CorsBuilder::allowCredentials
Configures credentials support.
Description
Section titled “Description”Configures whether credentials are allowed in cross-origin requests.
Syntax
Section titled “Syntax”CorsBuilder& allowCredentials(bool enabled = true);Return Value
Section titled “Return Value”A reference to the current CorsBuilder instance.
Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
enabled |
Whether credentials are allowed. Defaults to true. |
Remarks
Section titled “Remarks”Credentials cannot be enabled when all origins are allowed using allowAnyOrigin().
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.allowCredentials();See Also
Section titled “See Also”| Name | Description |
|---|---|
allowAnyOrigin |
Allows requests from any origin. |