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

fetching a binary file returns a corrupted body #70

Closed
jagobagascon opened this issue Sep 18, 2023 · 1 comment · Fixed by #78
Closed

fetching a binary file returns a corrupted body #70

jagobagascon opened this issue Sep 18, 2023 · 1 comment · Fixed by #78

Comments

@jagobagascon
Copy link

Hi! I'm using the fetch.NewRequest to build a proxy and serve files from a remote server, but non-text files are getting corrupted. The logs show the following warning:

Called .text() on an HTTP body which does not appear to be text. The body's Content-Type is "image/png". The result will probably be corrupted. Consider checking the Content-Type header before interpreting entities as text.

I was able to make it work by implementing my own toResponse function where I read the data from the blob.

@jagobagascon jagobagascon changed the title fetching a binary file causes an error fetching a binary file returns a corrupted body Sep 18, 2023
@syumai
Copy link
Owner

syumai commented Dec 31, 2023

@jagobagascon Thank you for reporting this issue!
This issue is solved in #78 and released as https://github.com/syumai/workers/releases/tag/v0.19.0.

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 a pull request may close this issue.

2 participants