gatus/controller/handler/cors.go

11 lines
265 B
Go
Raw Normal View History

2021-09-13 00:39:09 +02:00
package handler
import "net/http"
2021-09-13 00:39:09 +02:00
func DevelopmentCORS(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "http://localhost:8081")
next.ServeHTTP(w, r)
})
}