Revert because of ERR_H2_OR_QUIC_REQUIRED

Chrome throws ERR_H2_OR_QUIC_REQUIRED when we try to use a stream body on a
non-TLS HTTP request. This will break both dev setups on localhost, and perhaps
some self hosting setups, so is not a feasible path forward for an essential
endpoint to the use of the app.
This commit is contained in:
Manav Rathi
2025-05-21 19:29:12 +05:30
parent 1d276c795c
commit 5df009c7c7

View File

@@ -271,21 +271,7 @@ export const putFilePart = async (
fetch(partUploadURL, {
method: "PUT",
headers: publicRequestHeaders(),
// @ts-expect-error See: [Note: duplex param required for stream body]
duplex: "half",
// Pipe the part data via a transform stream so that we can report progress.
body: new Response(partData).body!.pipeThrough(
new TransformStream({
start() {
console.log("start");
},
transform(chunk, controller) {
console.log("chunk", chunk);
onProgress(chunk.length /* dummy value for now */);
controller.enqueue(chunk);
},
}),
),
body: partData,
}),
);
return nullToUndefined(res.headers.get("etag"));