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

Miniflare3: Add Content-Length and FixedLengthStream to R2 get response #712

Merged
merged 2 commits into from Oct 10, 2023

Conversation

gabivlj
Copy link

@gabivlj gabivlj commented Oct 9, 2023

Before this, we would see that the following code wouldn't work:

  const res = await env.BUCKET.get(name);
  await env.BUCKET.put(name, res!.body);

As it would throw:
TypeError: Provided readable stream must have a known length (request/response body or readable half of FixedLengthStream)

Before this, we would see that the following code wouldn't work:
```
  const res = await env.BUCKET.get(name);
  await env.BUCKET.put(name, res!.body);
```

As it would throw:
	TypeError: Provided readable stream must have a known length (request/response body or readable half of FixedLengthStream)
@changeset-bot
Copy link

changeset-bot bot commented Oct 9, 2023

⚠️ No Changeset found

Latest commit: 515865e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@mrbbot mrbbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! As part of reviewing this, I wrote a test. Rather than asking you to rewrite this, I've just committed it. 😃

@mrbbot mrbbot merged commit 7ec7fa3 into cloudflare:tre Oct 10, 2023
8 checks passed
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.

None yet

2 participants