CorsConfigDefinition
final class CorsConfigDefinition extends AbstractConfigDefinition (View source)
Builds one composable layer of cross-origin resource sharing configuration.
Properties
| protected mixed[] | $data | from AbstractConfigDefinition |
Methods
Replaces one configuration value at a dot-separated path.
Appends one configuration value at a dot-separated list path.
Creates an empty definition that contributes only explicitly configured values.
Returns the registry key under which CORS definitions are collected.
Sets whether CORS processing participates in the HTTP pipeline.
Disables CORS processing for this definition layer.
Replaces the allowed origin values contributed by this layer.
Replaces the allowed preflight method values contributed by this layer.
Replaces the allowed preflight header values contributed by this layer.
Replaces the response headers exposed to cross-origin clients.
Sets whether cross-origin responses may expose credentials.
Sets the browser preflight cache lifetime, or clears it with null.
Details
toArray
array
toArray()
No description
set
protected AbstractConfigDefinition
set(string $path, mixed $value)
Replaces one configuration value at a dot-separated path.
append
protected AbstractConfigDefinition
append(string $path, mixed $value)
Appends one configuration value at a dot-separated list path.
create
static CorsConfigDefinition
create()
Creates an empty definition that contributes only explicitly configured values.
moduleKey
static string
moduleKey()
Returns the registry key under which CORS definitions are collected.
enabled
CorsConfigDefinition
enabled(bool $enabled = true)
Sets whether CORS processing participates in the HTTP pipeline.
allowedOrigins
CorsConfigDefinition
allowedOrigins(array $origins)
Replaces the allowed origin values contributed by this layer.
allowedMethods
CorsConfigDefinition
allowedMethods(array $methods)
Replaces the allowed preflight method values contributed by this layer.
allowedHeaders
CorsConfigDefinition
allowedHeaders(array $headers)
Replaces the allowed preflight header values contributed by this layer.
exposedHeaders
CorsConfigDefinition
exposedHeaders(array $headers)
Replaces the response headers exposed to cross-origin clients.
allowCredentials
CorsConfigDefinition
allowCredentials(bool $allowCredentials = true)
Sets whether cross-origin responses may expose credentials.
maxAge
CorsConfigDefinition
maxAge(int|null $maxAge)
Sets the browser preflight cache lifetime, or clears it with null.