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: restore express prototypes so injecting doesn't break http requests #333

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gunjam
Copy link

@gunjam gunjam commented Jan 28, 2025

I'm attempting to port an internal express app test framework to use light-my-request because it hugely increases performance (thanks!), but some of the framework's plugins still need to make HTTP requests.

Currenlty the first inject() call will permenantly modify the app's request and response prototypes, making subsequent HTTP requests crash the server - this change fixes that by caching them and setting the back to the originals.

Ta

Checklist

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