-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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(cli/web/fetch): Make Response constructor standard #5787
Conversation
Currently, this is most likely a breaking change. Although I'd like to modify const res = await fetch("http://example.com/file.bin");
const file = await Deno.open("/tmp/file.bin", { create: true, write: true });
await Deno.copy(res.body, file);
file.close(); I'll submit the changes in a different PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@marcosc90 could you please merge with master? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks @marcosc90
Fixes #4667 #4748
type
)res.body
is now aReadableStream
All tests are passing without modification, only removed a single test that was testing the previous
Response
constructor.I'm not sure about
response.type
basic
,'error'
types set? In the previous implementation we weren't setting them either, so don't think this is a blocker right now.Used a
WeakMap
to avoid adding extra settings toResponseInit
to be spec-compliant. I could use symbols instead, so please let me know.Any comments or improvements are welcomed.