-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The HTTPS assumption is not correct in SAM-local environment, it cause integration errors #138
Comments
Thanks for the report @allinwonder. I'll look into it, so far as I can tell I have no easy way to tell whether the request came in as HTTP or HTTPS. The only useful field I could find is the CloudFront header: |
I think I can work around this. However, I have to rely on the X-Forwarded headers. Headers are easily spoofable and I'm not a huge fan of this solution so I've added lots of checking. If you want to enable custom domains, you will have to explicitly declare them in the I'm hoping to make all of this go away if/once API Gateway starts sending the full request uri in the proxy event. |
@sapessi given the headers are spoofable, developers can override the default behavior easily when they need. This means if the application can allow developers to use an override header for example |
Hey @allinwonder - I'm not as concerned about protocol as I am about the For the time being, my approach is this:
LambdaContainerHandler.getContainerConfig().addCustomDomain("api.myserver.com");
LambdaContainerHandler.getContainerConfig().enableLocalhost(); // shortcut for localhost
Any chance you could share the code you are using to generate those URLs so that I can add a unit test for this? |
…ture, it would be ideal to get the full request uri from API Gateway in the event.
This is resolved in the latest merge. 1.1 will go out shortly. Closing the issue |
We ran into integration issues in SAM-local when we try to use the context scheme to determine integration endpoint scheme. In SAM-Local, all endpoints are using HTTP instead HTTPS.
https://github.com/awslabs/aws-serverless-java-container/blob/60e5bfaa4e2463c7678a8c0d84f815c2034abe8a/aws-serverless-java-container-jersey/src/main/java/com/amazonaws/serverless/proxy/jersey/JerseyHandlerFilter.java#L176
The text was updated successfully, but these errors were encountered: