Skip to content
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

feat: add support for APIGWv2 protocol (#64) #88

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Photon0gen
Copy link

No description provided.

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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging TODO for feedback.

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;
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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('');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging this TODO for feedback. I think that this no longer works with the updated type definitions and needs to be removed.

@Photon0gen
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant