maxAge
mach::CorsBuilder::maxAge
Configures the preflight cache duration.
Description
Section titled “Description”Sets how long browsers may cache CORS preflight responses.
Syntax
Section titled “Syntax”CorsBuilder& maxAge(std::chrono::seconds maxAge);Return Value
Section titled “Return Value”A reference to the current CorsBuilder instance.
Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
maxAge |
The preflight cache duration. |
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.maxAge(std::chrono::minutes(10));