mirror of
https://github.com/minio/minio.git
synced 2025-01-12 07:23:23 -05:00
parent
6c2bc0568b
commit
f66239e82f
@ -326,11 +326,14 @@ 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 {
|
||||||
|
commonS3Headers := []string{"Content-Length", "Content-Type", "Connection",
|
||||||
|
"Date", "ETag", "Server", "x-amz-delete-marker", "x-amz-id-2",
|
||||||
|
"x-amz-request-id", "x-amz-version-id"}
|
||||||
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: commonS3Headers,
|
||||||
AllowCredentials: true,
|
AllowCredentials: true,
|
||||||
})
|
})
|
||||||
return c.Handler(h)
|
return c.Handler(h)
|
||||||
|
Loading…
Reference in New Issue
Block a user