Use the Claudia.js Gitter Chat instead to ask a general question or request assistance/support.
Please use GitHub issues only to report bugs with example projects. To report a bug or a problem, please fill in the sections below. The more you provide, the better we'll be able to help.
What actually happens:
whatever method I use the cors headers never change.
This is the output whatever I change:
{ "StatusCode": 200, "ExecutedVersion": "$LATEST", "Payload": "{\"statusCode\":200,\"headers\":{\"Content-Type\":\"application/json\",\"Access-Control-Allow-Origin\":\"*\",\"Access-Control-Allow-Headers\":\"Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token\",\"Access-Control-Allow-Methods\":\"GET,POST,OPTIONS\",\"Access-Control-Allow-Credentials\":\"true\",\"Access-Control-Max-Age\":\"0\"},\"body\":\"{\\\"info\\\":\\\"test\\\"}\"}" }
Link to a minimal, executable project that demonstrates the problem:
add the line:
api.corsOrigin(false)
into the example tutorial and the cors headers still come through as all allowed
worked out what I was doing wrong:
the apis.corsOrigin() method call has to be in the root of the module, NOT in the api.post('', ...) method callback as I was doing!
Use the Claudia.js Gitter Chat instead to ask a general question or request assistance/support.
Please use GitHub issues only to report bugs with example projects. To report a bug or a problem, please fill in the sections below. The more you provide, the better we'll be able to help.
Expected behaviour: using some of the cors override behaviour as described here: https://github.com/claudiajs/claudia-api-builder/blob/master/docs/cors.md should override the cors headers.
What actually happens: whatever method I use the cors headers never change. This is the output whatever I change:
{ "StatusCode": 200, "ExecutedVersion": "$LATEST", "Payload": "{\"statusCode\":200,\"headers\":{\"Content-Type\":\"application/json\",\"Access-Control-Allow-Origin\":\"*\",\"Access-Control-Allow-Headers\":\"Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token\",\"Access-Control-Allow-Methods\":\"GET,POST,OPTIONS\",\"Access-Control-Allow-Credentials\":\"true\",\"Access-Control-Max-Age\":\"0\"},\"body\":\"{\\\"info\\\":\\\"test\\\"}\"}" }
Link to a minimal, executable project that demonstrates the problem: add the line:
api.corsOrigin(false)
into the example tutorial and the cors headers still come through as all allowedSteps to install the project:
Steps to reproduce the problem: