Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: re-read request body from incoming.rawBody if available #223

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

usualoma
Copy link
Member

In some environments (e.g. firebase functions), the body is already consumed, but we can re-read the request body from incoming.rawBody in that case.

fix honojs/hono#1695

In some environments (e.g. firebase functions), the body is already consumed,
but we can re-read the request body from `incoming.rawBody` in that case.
@usualoma
Copy link
Member Author

@yusukebe
Would you please review?

@shriharip
Copy link

Would this mean, with this fix, we can just reuse the body instead of rawBody in firebase functions.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Member

yusukebe commented Jan 30, 2025

Hi @usualoma

This fix is interesting. And the honojs/hono#1695 is completely fixed by this! I'll merge it now. Thank you so much!

@yusukebe yusukebe merged commit 105a5cf into honojs:main Jan 30, 2025
3 checks passed
@usualoma usualoma deleted the fix/reread-from-rawbody branch January 30, 2025 22:24
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Response body object should not be disturbed or locked
3 participants