Skip to content
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

Revert the major breaking change in 4.3.10 #455

Merged
merged 1 commit into from
Aug 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/event-sources/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ const url = require('url')
function getPathWithQueryStringParams ({
event,
query = event.multiValueQueryStringParameters,
// NOTE: Always use event.path, if the API gateway has custom route setup, for example if my controllers path is
// something like employee/services/service1, employee/services/service2 etc, if I dont have any custom path/resources setup
// and directly have root/{proxy+} it works as expected, if i have a resource like /employee and child to that if there
// is a resource like {proxy+} it is not working as expected and errors out with 404. This change is required to address that
// specific issue.
path = event.path,
// NOTE: Use `event.pathParameters.proxy` if available ({proxy+}); fall back to `event.path`
path = (event.pathParameters && event.pathParameters.proxy && `/${event.pathParameters.proxy}`) || event.path,
// NOTE: Strip base path for custom domains
stripBasePath = '',
replaceRegex = new RegExp(`^${stripBasePath}`)
Expand Down