Skip to content

Commit

Permalink
fix: revert #441 (#455)
Browse files Browse the repository at this point in the history
Revert to the old behavior of just routing on the proxy part.

4.3.10 is a major breaking change for existing users depending on the current behavior.

This will fix #454
  • Loading branch information
alexanderbh committed Aug 31, 2021
1 parent b06051c commit 87aa26f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/event-sources/utils.js
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

0 comments on commit 87aa26f

Please sign in to comment.