mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
parent
6c2bc0568b
commit
f66239e82f
@ -326,11 +326,14 @@ var defaultAllowableHTTPMethods = []string{
|
||||
|
||||
// setCorsHandler handler for CORS (Cross Origin Resource Sharing)
|
||||
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{
|
||||
AllowedOrigins: []string{"*"},
|
||||
AllowedMethods: defaultAllowableHTTPMethods,
|
||||
AllowedHeaders: []string{"*"},
|
||||
ExposedHeaders: []string{"ETag"},
|
||||
ExposedHeaders: commonS3Headers,
|
||||
AllowCredentials: true,
|
||||
})
|
||||
return c.Handler(h)
|
||||
|
Loading…
Reference in New Issue
Block a user