workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: `getPlatformProxy` does not accept Node `ReadableStream`s

Open helloimalastair opened this issue 1 year ago • 1 comments

Which Cloudflare product(s) does this pertain to?

R2, Wrangler

What version(s) of the tool(s) are you using?

3.71.0

What version of Node are you using?

22.6.0

What operating system and version are you using?

MacOS Sonoma 14.6.1

Describe the Bug

Observed behavior

When calling R2.put in an R2Bucket binding from getPlatformProxy(), you get the error

Provided readable stream must have a known length (request/response body or readable half of FixedLengthStream)

Even if the ReadableStream used was derived from a Request.

Expected behavior

R2.put should accept a ReadableStream with a known length.

Steps to reproduce

  1. Clone repo below & install dependencies.
  2. node index

Please provide a link to a minimal reproduction

https://github.com/helloimalastair/streamprox

helloimalastair avatar Aug 15 '24 16:08 helloimalastair

Good feedback cc @jonesphillip @dario-piotrowicz @jasnell

irvinebroque avatar Aug 15 '24 17:08 irvinebroque