Skip to content

Commit

Permalink
Set CORS Access-Control-Max-Age header to one day
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Oct 29, 2023
1 parent cf1941c commit b3d685c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/response/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ func AddCORSHeaders(w http.ResponseWriter) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Authorization")
// Allow browsers to cache above for 1 day
w.Header().Set("Access-Control-Max-Age", "86400")
}

0 comments on commit b3d685c

Please sign in to comment.