Skip to content

Commit efe98bc

Browse files
committed
Uploading hosted images now relies on base64 decoding on the server side
1 parent ef3b1e1 commit efe98bc

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

src/cloudflare/internal/images-api.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -275,23 +275,7 @@ class HostedImagesBindingImpl implements HostedImagesBinding {
275275
image: ReadableStream<Uint8Array> | ArrayBuffer,
276276
options?: ImageUploadOptions
277277
): Promise<ImageMetadata> {
278-
let processedImage: ReadableStream<Uint8Array> | ArrayBuffer = image;
279-
280-
if (options?.encoding === 'base64') {
281-
const stream =
282-
image instanceof ReadableStream
283-
? image
284-
: new ReadableStream({
285-
start(controller): void {
286-
controller.enqueue(new Uint8Array(image));
287-
controller.close();
288-
},
289-
});
290-
291-
processedImage = stream.pipeThrough(createBase64DecoderTransformStream());
292-
}
293-
294-
return this.#fetcher.upload(processedImage, options);
278+
return this.#fetcher.upload(image, options);
295279
}
296280

297281
async update(

0 commit comments

Comments
 (0)