question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Internal server error when request method OPTIONS

See original GitHub issue

Had 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:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:26 (3 by maintainers)

github_iconTop GitHub Comments

20reactions
dinvladcommented, May 22, 2017

With the help from staff on AWS forums, I’ve resolved it by adding:

x-amazon-apigateway-integration:
  contentHandling: CONVERT_TO_TEXT
  ...

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.

4reactions
dinvladcommented, Aug 14, 2017

@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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found