serverless-apigw-binary icon indicating copy to clipboard operation
serverless-apigw-binary copied to clipboard

get OPTIONS working

Open mvayngrib opened this issue 8 years ago • 10 comments
trafficstars

uses the trick learned here: https://github.com/awslabs/aws-serverless-express/issues/58 https://github.com/awslabs/aws-serverless-express/issues/58#issuecomment-303193847 https://github.com/awslabs/aws-serverless-express/issues/58#issuecomment-322263402

to solve the problem discussed here; https://github.com/serverless/serverless/issues/2797#issuecomment-331698109

i also refactored the stage/apiId variables to be instance variables, they were a pain to pass around

i understand if you don't want to merge this for lack of tests, so either I'll get to it when I have time, or someone else will :)

mvayngrib avatar Nov 02 '17 21:11 mvayngrib

@mvayngrib Thanks for this PR!

Yup, you're right. We definetely need tests here. I will try to add some, but I am afraid that it won't happen quickly (my backlog is really full for next 2 months).

So if you will have any free time, please add those.

Thanks i advance!

maciejtreder avatar Nov 03 '17 13:11 maciejtreder

todo: load the cors config from the function's cors config

mvayngrib avatar Nov 07 '17 18:11 mvayngrib

We really need this feature in place, so anyone can help to get this PR merged?

Thank in advance!

stormit-vn avatar Nov 10 '17 16:11 stormit-vn

@mvayngrib Could you resolve conflicts with the master branch, so we could go forward with merge?

maciejtreder avatar Nov 12 '17 20:11 maciejtreder

@maciejtreder I updated the PR.

Keep in mind that this is still missing copying over of the cors config, so if people have custom headers they want allowed, they will be sad :)

mvayngrib avatar Nov 12 '17 21:11 mvayngrib

@mvayngrib Ouch... You're right..

Will you find time to implement CORS configuration rewrite/copy?

maciejtreder avatar Nov 12 '17 21:11 maciejtreder

@maciejtreder i was trying to see the other day how serverless parses it out, and it's somewhere in the bowels of the code: https://github.com/serverless/serverless/blob/master/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js#L298

do you know how we might access that method?

mvayngrib avatar Nov 12 '17 21:11 mvayngrib

any update on this? what's missing? anything I can help with?

rcstr avatar Mar 26 '18 16:03 rcstr

@rcstr yep! Read above about CORS

mvayngrib avatar Mar 26 '18 16:03 mvayngrib

Hello,

is there any status update here?

Ponjimon avatar Jul 17 '19 18:07 Ponjimon