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(readBody, readRawBody): use global symbol #174

Merged
merged 1 commit into from Sep 3, 2022

Conversation

chmking
Copy link
Contributor

@chmking chmking commented Sep 3, 2022

This addresses the issues of #170 where a second read from the body in a different library causes the request to hang.

Changing this to use Symbol.for() will first check the global registry for the symbol before generating a new one. I assume this means that different registries will share the same Symbol for the body and correctly early out once processed.

@pi0 pi0 changed the title Switched to global registry for h3RawBody and h3ParsedBody fix(useBody): use global symbol Sep 3, 2022
@pi0 pi0 changed the title fix(useBody): use global symbol fix(readBody, readRawBody): use global symbol Sep 3, 2022
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 merged commit dcf208a into unjs:main Sep 3, 2022
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.

None yet

2 participants