dev #16
@@ -48,31 +48,31 @@
|
|||||||
|
|
||||||
# 0=origin, 1=methods, 2=headers, 3=allow credentials, 4=max age, 5=vary, 6=expose headers
|
# 0=origin, 1=methods, 2=headers, 3=allow credentials, 4=max age, 5=vary, 6=expose headers
|
||||||
(cors) {
|
(cors) {
|
||||||
@match-cors-preflight-{args.0} {
|
@match-cors-preflight-{args[0]} {
|
||||||
header Origin {args.0}
|
header Origin {args[0]}
|
||||||
method OPTIONS
|
method OPTIONS
|
||||||
}
|
}
|
||||||
header @match-cors-preflight-{args.0} {
|
header @match-cors-preflight-{args[0]} {
|
||||||
Access-Control-Allow-Origin "{args.0}"
|
Access-Control-Allow-Origin "{args[0]}"
|
||||||
Access-Control-Allow-Methods "{args.1}"
|
Access-Control-Allow-Methods "{args[1]}"
|
||||||
Access-Control-Allow-Headers "{args.2}"
|
Access-Control-Allow-Headers "{args[2]}"
|
||||||
Access-Control-Allow-Credentials "{args.3}"
|
Access-Control-Allow-Credentials "{args[3]}"
|
||||||
Access-Control-Max-Age "{args.4}"
|
Access-Control-Max-Age "{args[4]}"
|
||||||
Vary "{args.5}"
|
Vary "{args[5]}"
|
||||||
}
|
}
|
||||||
handle @match-cors-preflight-{args.0} {
|
handle @match-cors-preflight-{args[0]} {
|
||||||
respond "" 204
|
respond "" 204
|
||||||
}
|
}
|
||||||
|
|
||||||
@match-cors-request-{args.0} {
|
@match-cors-request-{args[0]} {
|
||||||
header Origin {args.0}
|
header Origin {args[0]}
|
||||||
not method OPTIONS
|
not method OPTIONS
|
||||||
}
|
}
|
||||||
header @match-cors-request-{args.0} {
|
header @match-cors-request-{args[0]} {
|
||||||
>Access-Control-Allow-Origin "{args.0}"
|
>Access-Control-Allow-Origin "{args[0]}"
|
||||||
>Access-Control-Allow-Credentials "{args.3}"
|
>Access-Control-Allow-Credentials "{args[3]}"
|
||||||
>Vary "{args.5}"
|
>Vary "{args[5]}"
|
||||||
>Access-Control-Expose-Headers "{args.6}"
|
>Access-Control-Expose-Headers "{args[6]}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user