fix: missing CORS headers when auth fails (#9251)

This commit is contained in:
Johannes Würbach 2022-12-05 02:49:01 +01:00 committed by GitHub
parent 785458cceb
commit 3aa53aaf5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 4 deletions

View file

@ -1268,6 +1268,10 @@ stream {
deny all;
{{ end }}
{{ if $location.CorsConfig.CorsEnabled }}
{{ template "CORS" $location }}
{{ end }}
{{ if not (isLocationInLocationList $location $all.Cfg.NoAuthLocations) }}
{{ if $authPath }}
# this location requires authentication
@ -1329,10 +1333,6 @@ stream {
{{ range $limit := $limits }}
{{ $limit }}{{ end }}
{{ if $location.CorsConfig.CorsEnabled }}
{{ template "CORS" $location }}
{{ end }}
{{ buildInfluxDB $location.InfluxDB }}
{{ if isValidByteSize $location.Proxy.BodySize true }}