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

fix: response body access converting body as string #81

Merged
merged 2 commits into from Dec 20, 2021

Conversation

kiwiyou
Copy link
Contributor

@kiwiyou kiwiyou commented Nov 5, 2021

This fixes #80.

@nilslice
Copy link
Contributor

nilslice commented Nov 5, 2021

Hi @kiwiyou - thanks for this! Would you mind sharing how you are constructing the request which triggers this branch? using curl would be ideal, but if you have another way already that would be great too.

EDIT: actually, this is probably something you are returned from a call to Fetch or similar within the Worker as a sub-request? Any example endpoint or resource being streamed would be great to see!

@kiwiyou
Copy link
Contributor Author

kiwiyou commented Nov 6, 2021

When I sent a request to https://static.solved.ac/misc/default_profile.png (CDN server of other person) worker-rs retrieves the body well. However, when I used CfProperties to set cache_everything on, Called .text() on an HTTP body which does not appear to be text. message appeared and the image did not render properly.

@nilslice
Copy link
Contributor

nilslice commented Dec 2, 2021

Hi @kiwiyou - thank you for the follow-up. If you are ready for this to be reviewed, please update from Draft to normal PR. No rush, I just didn't want you to think it's blocked on anything else.

I haven't taken a close look, thinking you are still working on some aspects of it. But if it's ready, I'm happy to put it in my review rotation. Thanks!

@kiwiyou kiwiyou marked this pull request as ready for review December 5, 2021 15:24
@nilslice nilslice changed the base branch from main to pr-81 December 20, 2021 22:55
@nilslice nilslice merged commit e090f6b into cloudflare:pr-81 Dec 20, 2021
@nilslice
Copy link
Contributor

Thank you!

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.

Accessing response body forces string conversion
2 participants