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

fix: initialise res.req #80

Merged
merged 3 commits into from
Mar 31, 2022
Merged

fix: initialise res.req #80

merged 3 commits into from
Mar 31, 2022

Conversation

danielroe
Copy link
Member

otherwise res.req is undefined

@danielroe danielroe self-assigned this Mar 30, 2022
@danielroe danielroe requested a review from pi0 March 30, 2022 11:18
src/event.ts Outdated
res.req.res = res
// @ts-ignore
res.req.req = req
res.req = req
Copy link
Member

Choose a reason for hiding this comment

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

Node.js standard res has a req property attached to which is a little bit different than the incoming req!

I think this is originating from unenv mocks that res.req is unset.

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe we can just check if res.req exists then? (and possibly also resolve in unenv mock)

Copy link
Member

Choose a reason for hiding this comment

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

Or we could add res.req polyfill if not existing :)

@pi0 pi0 merged commit 57db02d into main Mar 31, 2022
@pi0 pi0 deleted the fix/res-req-init branch March 31, 2022 10:27
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.

2 participants