cloudflare / cloudflare/workerd

Constructing a Request with a stream must hold the original object

Open
#4,976 0 comments 0 reactions 0 assignees View on GitHub
wpt-conformance
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

See `fetch/api/request/request-init-stream.any.js`:

If you just do

```js
const body = new ReadableStream();
const request = new Request("...", { method, body, duplex });
assert_equals(request.body, body);
```

`request.body` doesn't equal `body`. I'm not quite sure what we're doing, but here's what changes:

```patch
ReadableStream {
- locked: false,
- [state]: 'readable',
+ locked: true,
+ [state]: 'closed',
[supportsBYOB]: false,
[length]: undefined
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.