feat: add support for APIGWv2 protocol (#64)#88
Draft
Photon0gen wants to merge 2 commits intosilvermine:masterfrom
Draft
feat: add support for APIGWv2 protocol (#64)#88Photon0gen wants to merge 2 commits intosilvermine:masterfrom
Photon0gen wants to merge 2 commits intosilvermine:masterfrom
Conversation
Photon0gen
commented
Jun 10, 2024
Comment on lines
+508
to
+510
| // TODO - is option 1 safe? If so, then it is the simpler approach | ||
| // Option 1. join evt.cookies with semicolons | ||
| // Option 2. reduce the list, parseing and merging into cookies |
Comment on lines
+31
to
34
| export function isALBResult(evt: ResponseResult, test: boolean): evt is ALBResult { | ||
| // TODO - this type gaurd doesn't do any useful checking | ||
| return test && 'statusCode' in evt; | ||
| } |
Author
There was a problem hiding this comment.
Flagging this TODO for feedback on this approach to using a type guard. Doesn't seem to be any attributes that can consistently be used to differentiate between the types. So seems like we can either:
A. Use a type guard like this.
B. Extend ALBResult to have an attribute we set to indicate if it is ALB, and then base the type guard on that attribute.
Comment on lines
-48
to
+58
| // make sure that undefined values don't break it: | ||
| let evt2: RequestEvent = albRequest(); | ||
| // TODO - this doesn't seem possible without encountering: error TS2790: The operand of a 'delete' operator must be optional. | ||
| // // make sure that undefined values don't break it: | ||
| // let evt2: RequestEvent = albRequest(); | ||
|
|
||
| delete evt2.httpMethod; | ||
| expect(evt2.httpMethod).to.strictlyEqual(undefined); | ||
| expect(new Request(app, evt2, handlerContext()).method).to.strictlyEqual(''); | ||
| // delete evt2.httpMethod; | ||
| // expect(evt2.httpMethod).to.strictlyEqual(undefined); | ||
| // expect(new Request(app, evt2, handlerContext()).method).to.strictlyEqual(''); |
Author
There was a problem hiding this comment.
Flagging this TODO for feedback. I think that this no longer works with the updated type definitions and needs to be removed.
Author
|
I will split the package upgrades and related changes into a separate pull request, but figured it would be simpler to get initial feedback with all the changes together. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.