Skip to content

Set-PodeSecurityAccessControl

SYNOPSIS

Set definitions for Access-Control headers.

SYNTAX

Set-PodeSecurityAccessControl [[-Origin] <String>] [[-Methods] <String[]>] [[-Headers] <String[]>]
 [[-Duration] <Int32>] [-Credentials] [-WithOptions] [<CommonParameters>]

DESCRIPTION

Removes definitions for the Access-Control headers: Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers, Access-Control-Max-Age, Access-Control-Allow-Credentials

EXAMPLES

EXAMPLE 1

Set-PodeSecurityAccessControl -Origin '*' -Methods '*' -Headers '*' -Duration 7200

PARAMETERS

-Credentials

Specifies a value for Access-Control-Allow-Credentials

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Duration

Specifies a value for Access-Control-Max-Age in seconds. (Default: 7200)

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: 7200
Accept pipeline input: False
Accept wildcard characters: False

-Headers

Specifies a value for Access-Control-Allow-Headers.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Methods

Specifies a value for Access-Control-Allow-Methods.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Origin

Specifies a value for Access-Control-Allow-Origin.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WithOptions

If supplied, a global Options Route will be created.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

Back to top