nginx-proxy-manager/backend/internal/api/middleware/access_control.go

14 lines
300 B
Go

package middleware
import (
"net/http"
)
// AccessControl sets http headers for responses
func AccessControl(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
next.ServeHTTP(w, r)
})
}