Skip to content

Commit 87aa26f

Browse files
authored
fix: revert #441 (#455)
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
1 parent b06051c commit 87aa26f

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/event-sources/utils.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ const url = require('url')
33
function getPathWithQueryStringParams ({
44
event,
55
query = event.multiValueQueryStringParameters,
6-
// NOTE: Always use event.path, if the API gateway has custom route setup, for example if my controllers path is
7-
// something like employee/services/service1, employee/services/service2 etc, if I dont have any custom path/resources setup
8-
// and directly have root/{proxy+} it works as expected, if i have a resource like /employee and child to that if there
9-
// is a resource like {proxy+} it is not working as expected and errors out with 404. This change is required to address that
10-
// specific issue.
11-
path = event.path,
6+
// NOTE: Use `event.pathParameters.proxy` if available ({proxy+}); fall back to `event.path`
7+
path = (event.pathParameters && event.pathParameters.proxy && `/${event.pathParameters.proxy}`) || event.path,
128
// NOTE: Strip base path for custom domains
139
stripBasePath = '',
1410
replaceRegex = new RegExp(`^${stripBasePath}`)

0 commit comments

Comments
 (0)