mirror of
https://github.com/minio/minio.git
synced 2025-07-14 19:31:52 -04:00
cors: Set Access-Control-Allow-Credentials to true (#4185)
This allow browsers to send credentials with preflighted requests.
This commit is contained in:
parent
3a539ce660
commit
d36dd80a8a
@ -274,10 +274,11 @@ var defaultAllowableHTTPMethods = []string{
|
|||||||
// setCorsHandler handler for CORS (Cross Origin Resource Sharing)
|
// setCorsHandler handler for CORS (Cross Origin Resource Sharing)
|
||||||
func setCorsHandler(h http.Handler) http.Handler {
|
func setCorsHandler(h http.Handler) http.Handler {
|
||||||
c := cors.New(cors.Options{
|
c := cors.New(cors.Options{
|
||||||
AllowedOrigins: []string{"*"},
|
AllowedOrigins: []string{"*"},
|
||||||
AllowedMethods: defaultAllowableHTTPMethods,
|
AllowedMethods: defaultAllowableHTTPMethods,
|
||||||
AllowedHeaders: []string{"*"},
|
AllowedHeaders: []string{"*"},
|
||||||
ExposedHeaders: []string{"ETag"},
|
ExposedHeaders: []string{"ETag"},
|
||||||
|
AllowCredentials: true,
|
||||||
})
|
})
|
||||||
return c.Handler(h)
|
return c.Handler(h)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user