[Question] Internal server error when request method OPTIONS
See original GitHub issueHad anyone same issue? When I try via postman make a request method OPTIONS the response is
{"message": "Internal server error"}
if I try in API Gateway Console, lambda Console, npm run local and npm run invoke-lambda the response is ok. Any idea what is the problem?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:26 (3 by maintainers)
Top Results From Across the Web
Response to CORS preflight OPTIONS request is 500 Internal ...
The problem you need to solve is, the server you're sending the request to is responding to OPTIONS requests with a 500 Internal...
Read more >500 Internal Server Error - HTTP - MDN Web Docs - Mozilla
This error response is a generic "catch-all" response. Usually, this indicates the server cannot find a better 5xx error code to response.
Read more >500 Internal Server Error for OPTION method?
My question here is: why the 500 error? As in the past, we would get a 501 Not Implemented. And if we received...
Read more >How to Fix a 500 Internal Server Error on Your WordPress Site
The 500 Internal Server Error status code occurs when the server encounters an error that prevents it from fulfilling the request.
Read more >500 Internal Server Error | Apigee Edge
The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With the help from staff on AWS forums, I’ve resolved it by adding:
which now returns a correct 200 response for the OPTIONS request. It wasn’t obvious we needed to do that however, especially that this option is not available for Mock requests through the Console yet.
@samikarak that needs to be added to the configuration of your OPTIONS methods in the Swagger template (https://github.com/awslabs/aws-serverless-express/blob/master/example/simple-proxy-api.yaml#L43)