mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
Make fetch.blob() work
This commit is contained in:
parent
662e57b20a
commit
4b1eb855bf
3 changed files with 14 additions and 3 deletions
|
@ -20,6 +20,7 @@ import {
|
|||
FormData
|
||||
} from "./dom_types";
|
||||
import { TextDecoder } from "./text_encoding";
|
||||
import { DenoBlob } from "./blob";
|
||||
|
||||
interface Header {
|
||||
name: string;
|
||||
|
@ -134,8 +135,10 @@ class FetchResponse implements Response {
|
|||
}
|
||||
|
||||
async blob(): Promise<Blob> {
|
||||
notImplemented();
|
||||
return {} as Blob;
|
||||
const arrayBuffer = await this.arrayBuffer();
|
||||
return new DenoBlob([arrayBuffer], {
|
||||
type: this.headers.get("content-type") || ""
|
||||
});
|
||||
}
|
||||
|
||||
async formData(): Promise<FormData> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue