.github
backend
cmd
embed
internal
acme
api
context
filters
handler
http
middleware
access_control.go
auth.go
auth_cache.go
body_context.go
cors.go
enforce_setup.go
expansion.go
filters.go
pretty_print.go
schema.go
schema
router.go
router_test.go
server.go
cache
config
database
dnsproviders
entity
errors
jobqueue
jwt
logger
model
nginx
status
types
util
validator
scripts
.editorconfig
.golangci.yml
.nancy-ignore
README.md
Taskfile.yml
go.mod
go.sum
docker
docs
frontend
scripts
test
.dockerignore
.gitignore
.version
DEV-README.md
Jenkinsfile
LICENSE
README.md
14 lines
300 B
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)
|
|
})
|
|
}
|