-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
fix: event.resource in catch-all route gets + changed to * #1524
Conversation
@@ -146,7 +146,11 @@ export default class LambdaProxyIntegrationEvent { | |||
const httpMethod = method.toUpperCase() | |||
const requestTime = formatToClfTime(received) | |||
const requestTimeEpoch = received | |||
const resource = this.#routeKey || route.path.replace(`/${this.#stage}`, '') | |||
// const resource = this.#routeKey || route.path.replace(`/${this.#stage}`, '') | |||
// NOTE Removed * added by generateHapiPath so api gateway event is accurategenerateHapiPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// NOTE Removed Replaced...?
what is accurategenerateHapiPath
?
thank you @Ankcorn ! added some comments, otherwise looks good.
|
woops a few typo's here, serves me right for making PR's at midnight. I have fixed those up, thanks for checking the http api :) |
happens to me fairly often as well 😆 |
Description
Replaces the * added by the generateHapiPath util for rest apis as this does not match the events from AWS
Motivation and Context
I ran into this bug event.resource in catch-all route gets + changed to * whilst testing out some changes to TRPC and their lambda adaptor.
How Has This Been Tested?
I added a new e2e test to cover the described behavior and it asserts that the resource contains the + character as expected
Screenshots (if appropriate):
N/A
fixes: #1431