Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CorsRules does not support ExposeHeader #6669

Open
Laurian opened this issue Sep 11, 2019 · 1 comment
Open

CorsRules does not support ExposeHeader #6669

Laurian opened this issue Sep 11, 2019 · 1 comment

Comments

@Laurian
Copy link

Laurian commented Sep 11, 2019

This is a Bug Report

Description

  • What went wrong?
    sls deploy reported An error occurred: StorageBucket - Encountered unsupported property ExposeHeader.

  • What did you expect should have happened?

sls to update the bucket’s CORS Policy with:

<ExposeHeader>x-amz-server-side-encryption</ExposeHeader>
<ExposeHeader>x-amz-request-id</ExposeHeader>
<ExposeHeader>x-amz-id-2</ExposeHeader>
<ExposeHeader>ETag</ExposeHeader>
  • What was the config you used?
resources:
  Resources:
    StorageBucket:
      Type: AWS::S3::Bucket
      DeletionPolicy: Retain
      Properties:
        BucketName: ${self:custom.bucketName}
        CorsConfiguration:
          CorsRules:
            - AllowedOrigins:
                - "*"
              AllowedHeaders:
                - "*"
              AllowedMethods:
                - GET
                - PUT
                - POST
                - DELETE
                - HEAD
              MaxAge: 3000
              ExposeHeader:
                - x-amz-server-side-encryption
                - x-amz-request-id
                - x-amz-id-2
                - ETag
  • What stacktrace or error message from your provider did you see?

Without ExposeHeader support I cannot upload to S3 from browser with aws-amplify

AWSS3Provider - error uploading ETagMissing:
No access to ETag property on response.
Check CORS configuration to expose ETag header

Similar or dependent issues:

Additional Data

  • Serverless Framework Version you're using: 1.51.0
  • Operating System: macOS 10.15 beta
  • Provider Error messages: AWSS3Provider - error uploading ETagMissing: No access to ETag property on response. Check CORS configuration to expose ETag header.
@drexler
Copy link
Contributor

drexler commented Sep 12, 2019

@Laurian looks like you have a typo. What you want is ExposedHeaders. so:

 ExposedHeaders:
    - x-amz-server-side-encryption
    - x-amz-request-id
    - x-amz-id-2
    - ETag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants