Skip to content

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
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.

TypeError: Response body object should not be disturbed or locked

3 participants