From 99e240eec0f2f89175ad8572d420d21fe6ea2a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=20Nam=C3=A8che?= Date: Tue, 3 Feb 2026 14:25:35 +0300 Subject: [PATCH] caddy: Caddyfile syntax args.0 -> args[0] --- seb4itik/byow/roles/caddy/templates/Caddyfile | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/seb4itik/byow/roles/caddy/templates/Caddyfile b/seb4itik/byow/roles/caddy/templates/Caddyfile index 674224a..fb38895 100644 --- a/seb4itik/byow/roles/caddy/templates/Caddyfile +++ b/seb4itik/byow/roles/caddy/templates/Caddyfile @@ -48,31 +48,31 @@ # 0=origin, 1=methods, 2=headers, 3=allow credentials, 4=max age, 5=vary, 6=expose headers (cors) { - @match-cors-preflight-{args.0} { - header Origin {args.0} + @match-cors-preflight-{args[0]} { + header Origin {args[0]} method OPTIONS } - header @match-cors-preflight-{args.0} { - Access-Control-Allow-Origin "{args.0}" - Access-Control-Allow-Methods "{args.1}" - Access-Control-Allow-Headers "{args.2}" - Access-Control-Allow-Credentials "{args.3}" - Access-Control-Max-Age "{args.4}" - Vary "{args.5}" + header @match-cors-preflight-{args[0]} { + Access-Control-Allow-Origin "{args[0]}" + Access-Control-Allow-Methods "{args[1]}" + Access-Control-Allow-Headers "{args[2]}" + Access-Control-Allow-Credentials "{args[3]}" + Access-Control-Max-Age "{args[4]}" + Vary "{args[5]}" } - handle @match-cors-preflight-{args.0} { + handle @match-cors-preflight-{args[0]} { respond "" 204 } - @match-cors-request-{args.0} { - header Origin {args.0} + @match-cors-request-{args[0]} { + header Origin {args[0]} not method OPTIONS } - header @match-cors-request-{args.0} { - >Access-Control-Allow-Origin "{args.0}" - >Access-Control-Allow-Credentials "{args.3}" - >Vary "{args.5}" - >Access-Control-Expose-Headers "{args.6}" + header @match-cors-request-{args[0]} { + >Access-Control-Allow-Origin "{args[0]}" + >Access-Control-Allow-Credentials "{args[3]}" + >Vary "{args[5]}" + >Access-Control-Expose-Headers "{args[6]}" } }