Open wpfnihao opened 4 years ago
Is your feature request related to a problem? Please describe. When using aws s3 sdk to set cors rules, error occurred. code:
func setCors(bucketName string) error { region := "cn-northwest-1" if tools.Config.S3Region != "" { region = tools.Config.S3Region } sess := session.Must(session.NewSessionWithOptions(session.Options{ SharedConfigState: session.SharedConfigEnable, Config: aws.Config{ Region: aws.String(region), Endpoint: aws.String(Key.EndPoint), //Bucket所在Endpoint HTTPClient: func() *http.Client { return &http.Client{ Transport: func() *http.Transport { return &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}} }(), Timeout: 3 * time.Second, } }(), //S3ForcePathStyle: aws.Bool(true), }, })) svc := s3.New(sess) rule := s3.CORSRule{ AllowedHeaders: aws.StringSlice([]string{"*"}), AllowedOrigins: aws.StringSlice([]string{"*"}), MaxAgeSeconds: aws.Int64(3000), // Add HTTP methods CORS request that were specified in the CLI. AllowedMethods: aws.StringSlice([]string{"PUT", "POST", "GET"}), } params := s3.PutBucketCorsInput{ Bucket: aws.String(bucketName), CORSConfiguration: &s3.CORSConfiguration{ CORSRules: []*s3.CORSRule{&rule}, }, } _, err := svc.PutBucketCors(¶ms) if err != nil { log.Println("setCors, invoke s3 PutBucketCors error:", err) return err } log.Printf("setCors, Updated bucket %q CORS finished\n", bucketName) return nil }
error message from noobaa:
A header you provided implies functionality that is not implemented. status code: 501, request id: kc1muixr-as3c6z-12kx, host id: kc1muixr-as3c6z-12kx
Describe the solution you'd like Support S3 CORS API, just like S3 BucketPolicy API support in v5.3 'Bomberman'.
Describe alternatives you've considered Still thinking about it. If Noobaa developers know about any workarounds, please let me know.
Additional context NA.
This issue had no activity for too long - it will now be labeled stale. Update it to prevent it from getting closed.
This issue is stale and had no activity for too long - it will now be closed.
Is your feature request related to a problem? Please describe. When using aws s3 sdk to set cors rules, error occurred. code:
error message from noobaa:
Describe the solution you'd like Support S3 CORS API, just like S3 BucketPolicy API support in v5.3 'Bomberman'.
Describe alternatives you've considered Still thinking about it. If Noobaa developers know about any workarounds, please let me know.
Additional context NA.