tsndr / cloudflare-worker-router

A super lightweight router (1.0K) with middleware support and ZERO dependencies for Cloudflare Workers.
MIT License
227 stars 30 forks source link

Fix issue when returning ReadableStreams and other strange responses #7

Closed simonblund closed 2 years ago

simonblund commented 3 years ago

Hi! When trying to return a response manually cached to cf caches containing an image (png) I had several issues with the image containing bad data when returning it. This is perhaps a dirty fix for the issue, but at least you can see what my issue was and improve the solution.

tsndr commented 2 years ago

Thank you for your contribution, your PR has been released with v1.1.9 😉

tsndr commented 2 years ago

Oh and I renamed it from response.response to response.raw :)