fix(backend): added Content-Encoding to CORS for http service (#1245)

This commit is contained in:
Alexander 2023-05-11 14:13:09 +02:00 committed by GitHub
parent 7683c27abc
commit 3d193fd1d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,7 +119,7 @@ func (e *Router) corsMiddleware(next http.Handler) http.Handler {
// Prepare headers for preflight requests // Prepare headers for preflight requests
w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST") w.Header().Set("Access-Control-Allow-Methods", "POST")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type,Authorization") w.Header().Set("Access-Control-Allow-Headers", "Content-Type,Authorization,Content-Encoding")
if r.Method == http.MethodOptions { if r.Method == http.MethodOptions {
w.Header().Set("Cache-Control", "max-age=86400") w.Header().Set("Cache-Control", "max-age=86400")
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)