Coder Social home page Coder Social logo

API CORS about aws-sam-cli HOT 4 CLOSED

adrianlaraperez88 avatar adrianlaraperez88 commented on September 27, 2024
API CORS

from aws-sam-cli.

Comments (4)

adrianlaraperez88 avatar adrianlaraperez88 commented on September 27, 2024 1

Ready fixed

Auth: AddDefaultAuthorizerToCorsPreflight: false DefaultAuthorizer: authorizerBearer Authorizers:

CorsConfiguration: AllowHeaders: "'Content-Type,Origin,Accept,X-Requested-With,Authorization,X-Amz-Date'" AllowOrigin: "'*'" AllowMethods: "'*'" authorizerBearer:

Thank you !!

from aws-sam-cli.

lucashuy avatar lucashuy commented on September 27, 2024

Hi, is there a specific CORS error message you are getting when trying to visit the endpoint in a browser?

from aws-sam-cli.

romeubertho avatar romeubertho commented on September 27, 2024

Hello,

by looking at your code it seems you mixed Auth properties from AWS::Serverless::Api and AWS::Serverless::Function

Authorizers, AddDefaultAuthorizerToCorsPreflight, and DefaultAuthorizer is not a valid prop for Auth on an AWS::Serverless::Function resource, but it is for AWS::Serverless::Api

I suggest you add the Auth prop to your API resource.

Best regards.

from aws-sam-cli.

github-actions avatar github-actions commented on September 27, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

from aws-sam-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.