fix: corsAll from endpoint to middleware

This commit is contained in:
Geno 2020-11-27 13:48:46 +01:00
parent 09007a88bb
commit 146eec83a2
2 changed files with 9 additions and 6 deletions

View File

@ -2,7 +2,7 @@
scheme = "https"
permanent = true
[http.middlewares.corsAll.headers]
AccessControlAllowMethods= ["GET", "OPTIONS", "PUT"]
AccessControlAllowOrigin = "*"
AccessControlMaxAge = 100
AddVaryHeader = true
accessControlAllowMethods= ["GET", "OPTIONS", "PUT"]
accessControlAllowOrigin = "origin-list-or-null"
accessControlMaxAge = 100
addVaryHeader = true

View File

@ -20,9 +20,12 @@
[http.routers.{{r.name}}]
rule = "{{ r.rule }}"
{% if r.tls %}
entryPoints = ["websecure"{% if "corsAll" in r and r.corsAll %}, "corsAll"{% endif %}]
entryPoints = ["websecure"]
{% else %}
entryPoints = ["web"{% if "corsAll" in r and r.corsAll %}, "corsAll"{% endif %}]
entryPoints = ["web"]
{% endif %}
{% if "corsAll" in r and r.corsAll %}
middlewares = ["corsAll"]
{% endif %}
service = "{{r.name}}@file"
{% if r.tls %}