Add necessary safe headers under CORS (#5750)

Fixes #5748
This commit is contained in:
Harshavardhana 2018-04-02 17:51:32 -07:00 committed by kannappanr
parent 8eb838bf91
commit b052bfa79e

View File

@ -375,9 +375,18 @@ 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"}
commonS3Headers := []string{
"Date",
"ETag",
"Server",
"Connection",
"Accept-Ranges",
"Content-Range",
"Content-Encoding",
"Content-Length",
"Content-Type",
"x-amz-request-id",
}
c := cors.New(cors.Options{
AllowedOrigins: []string{"*"},
AllowedMethods: defaultAllowableHTTPMethods,