fix: corsAll from endpoint to middleware
This commit is contained in:
parent
09007a88bb
commit
146eec83a2
|
@ -2,7 +2,7 @@
|
||||||
scheme = "https"
|
scheme = "https"
|
||||||
permanent = true
|
permanent = true
|
||||||
[http.middlewares.corsAll.headers]
|
[http.middlewares.corsAll.headers]
|
||||||
AccessControlAllowMethods= ["GET", "OPTIONS", "PUT"]
|
accessControlAllowMethods= ["GET", "OPTIONS", "PUT"]
|
||||||
AccessControlAllowOrigin = "*"
|
accessControlAllowOrigin = "origin-list-or-null"
|
||||||
AccessControlMaxAge = 100
|
accessControlMaxAge = 100
|
||||||
AddVaryHeader = true
|
addVaryHeader = true
|
||||||
|
|
|
@ -20,9 +20,12 @@
|
||||||
[http.routers.{{r.name}}]
|
[http.routers.{{r.name}}]
|
||||||
rule = "{{ r.rule }}"
|
rule = "{{ r.rule }}"
|
||||||
{% if r.tls %}
|
{% if r.tls %}
|
||||||
entryPoints = ["websecure"{% if "corsAll" in r and r.corsAll %}, "corsAll"{% endif %}]
|
entryPoints = ["websecure"]
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
service = "{{r.name}}@file"
|
service = "{{r.name}}@file"
|
||||||
{% if r.tls %}
|
{% if r.tls %}
|
||||||
|
|
Loading…
Reference in New Issue