You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
causes Cloudflare Workers to issue the following warning:
Your worker called response.clone(), but did not read the body of both clones. This is wasteful, as it forces the system to buffer the entire response body in memory, rather than streaming it through. This may cause your worker to be unexpectedly terminated for going over the memory limit. If you only meant to copy the response headers and metadata (e.g. in order to be able to modify them), use new Response(response.body, response) instead.
The response is being read straight after cloning.
It is true that only the clone is being read in your code and this will be true for mostly every response consuming routine, but it is there for a reason, so that in case the library throws while processing the response, the developer can still access its body.
I will change this so that the clone() would have to be done by the developer before this routine as an opt-in.
What happened?
Running this
causes Cloudflare Workers to issue the following warning:
Version
v2.0.1
Runtime
Cloudflare Workers
Runtime Details
Wrangler compatibility_date = "2022-11-25"
Code to reproduce
Required
The text was updated successfully, but these errors were encountered: