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

update spec & wpts #2482

Merged
merged 7 commits into from
Dec 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix remaining WPT fail
  • Loading branch information
KhafraDev committed Dec 1, 2023
commit 1ef8cfc913189a6e2fb0bb57bd3890981385f15e
22 changes: 21 additions & 1 deletion lib/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,27 @@ function fetchFinale (fetchParams, response) {

// 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.
internalResponse.body.stream.pipeThrough(transformStream)
internalResponse.body.stream = transformStream.readable

const byteStream = new ReadableStream({
readableStream: transformStream.readable,
async start (controller) {
const reader = this.readableStream.getReader()

while (true) {
const { done, value } = await reader.read()

if (done) {
queueMicrotask(() => readableStreamClose(controller))
break
}

controller.enqueue(value)
}
},
type: 'bytes'
})

internalResponse.body.stream = byteStream
}
}

Expand Down
Loading