fix: use AllowOriginFunc in tus

This commit is contained in:
Derrick Hammer 2024-03-18 15:45:29 -04:00
parent 228cabd83b
commit 5b8a7f79f0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 1 deletions

View File

@ -386,7 +386,9 @@ func (w *s5TusJwtResponseWriter) WriteHeader(statusCode int) {
func BuildTusCors() func(h http.Handler) http.Handler { func BuildTusCors() func(h http.Handler) http.Handler {
mw := mw :=
cors.New(cors.Options{ cors.New(cors.Options{
AllowedOrigins: []string{"*"}, AllowOriginFunc: func(origin string) bool {
return true
},
AllowedMethods: []string{"GET", "POST", "PATCH", "DELETE", "HEAD", "OPTIONS"}, AllowedMethods: []string{"GET", "POST", "PATCH", "DELETE", "HEAD", "OPTIONS"},
AllowedHeaders: []string{ AllowedHeaders: []string{
"Authorization", "Authorization",