-
Notifications
You must be signed in to change notification settings - Fork 166
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
request.originalUrl does not include the first path segment #57
Comments
Yeah, I think this is related to https://github.com/dougmoscrop/serverless-http/pull/36/files The requestContex.path -- I thought it was "wrong" when you used a custom domain? I could be remembering wrong, or it got fixed/changed, either way, I will get some sites deployed and figure out what works best for everyone (with and without stage names, custom domains, etc) |
I still think my pull request #42 is the correct fix for this. However, since it would require changes for existing users who don't use custom domains, it would need to be a major bump of serverless-http with an explanation of how to upgrade. |
I think it's possible to build on it and make it do some kind of detection |
The problem with #42 was that people not using custom domains (Amazon endpoints) were not expecting the change in the path and their current code required changes to deal with the corrected behavior. Also offline support broke for them, most likely for the same reason but needs further investigation. See #42 (comment) for more details. This #42 (comment) outlines the three use cases for endpoints and how the If you are interested in taking another look, I can update #42 for head. |
I'm still trying to figure out if this is solvable in a way that makes everyone happy. |
There's new Edit: Just to reiterate what I've said elsewhere: |
The correct way to solve this is to use the I'm pretty sure it is impossible to have an application in API Gateway that seamlessly works for both custom domains and bare (execute-api) endpoints that have a different base path, i.e. ✔️
❌
|
request.originalUrl does not include the stage path segment from API Gateway.
Example of expected value:
/api-gateway-stage/my/route
Example of actual value:
/my/route
The correct path value is indicated in
event.requestContext.path
The text was updated successfully, but these errors were encountered: