Skip to content
Download

allowOrigin

mach::CorsBuilder::allowOrigin

Allows the specified origin.

Allows requests originating from the specified origin.

CorsBuilder& allowOrigin(std::string_view origin);

A reference to the current CorsBuilder instance.

Parameter Description
origin The origin to allow.

This method may be called multiple times to allow multiple origins.

This method is not thread-safe and should only be called during CORS configuration.

cors.allowOrigin("https://example.com");
Name Description
allowOrigins Allows multiple origins.