Skip to content
Download

allowOrigins

mach::CorsBuilder::allowOrigin

Allows multiple methods.

Allows requests using the specified HTTP methods.

CorsBuilder& allowMethods(std::initializer_list<http::Method> methods);

A reference to the current CorsBuilder instance.

Parameter Description
methods The Methods to allow.

This method may be called multiple times to add additional methods.

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

cors.allowMethods({
mach::http::Method::Get,
mach::http::Method::Post
});
Name Description
allowMethod Allows the specified method.