Skip to content

Commit 45edbfa

Browse files
selvendranayyaswamyselvendran.ayyaswamy
andauthored
fix: fix for non-root proxy+
Co-authored-by: selvendran.ayyaswamy <[email protected]>
1 parent 50f83d0 commit 45edbfa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/event-sources/utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ const url = require('url')
33
function getPathWithQueryStringParams ({
44
event,
55
query = event.multiValueQueryStringParameters,
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,
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,
812
// NOTE: Strip base path for custom domains
913
stripBasePath = '',
1014
replaceRegex = new RegExp(`^${stripBasePath}`)

0 commit comments

Comments
 (0)