mirror of
https://github.com/1f349/violet.git
synced 2024-11-21 19:01:39 +00:00
Patch to not use * for CORS auth header
This commit is contained in:
parent
f8dde8eebe
commit
333394cf89
@ -20,8 +20,9 @@ import (
|
|||||||
|
|
||||||
// serveApiCors outputs the cors headers to make APIs work.
|
// serveApiCors outputs the cors headers to make APIs work.
|
||||||
var serveApiCors = cors.New(cors.Options{
|
var serveApiCors = cors.New(cors.Options{
|
||||||
AllowedOrigins: []string{"*"}, // allow all origins for api requests
|
// allow all origins for api requests
|
||||||
AllowedHeaders: []string{"Content-Type", "Authorization"},
|
AllowOriginFunc: func(origin string) bool { return true },
|
||||||
|
AllowedHeaders: []string{"Content-Type", "Authorization"},
|
||||||
AllowedMethods: []string{
|
AllowedMethods: []string{
|
||||||
http.MethodGet,
|
http.MethodGet,
|
||||||
http.MethodHead,
|
http.MethodHead,
|
||||||
|
Loading…
Reference in New Issue
Block a user