This repository has been archived on 2025-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
web-app-template/middleware/corp.go
Tim Wundenberg 6a36eb0580
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 40s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 43s
feat(security): #273 enable corp
2024-11-23 21:26:22 +01:00

14 lines
254 B
Go

package middleware
import (
"net/http"
)
func Corp(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cross-Origin-Resource-Policy", "same-origin")
next.ServeHTTP(w, r)
})
}