diff options
| author | Parsa Ghadimi <me@qti3e.com> | 2018-09-14 22:26:37 +0430 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2018-09-14 12:50:32 -0700 |
| commit | 4b1eb855bf8fa33b802f5be67c93217eb582bc24 (patch) | |
| tree | 52165e354043494dad5856aa768939fc4fcacc7c /js/fetch.ts | |
| parent | 662e57b20adc7bbb7037c116f8f72678017db94e (diff) | |
Make fetch.blob() work
Diffstat (limited to 'js/fetch.ts')
| -rw-r--r-- | js/fetch.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/js/fetch.ts b/js/fetch.ts index 4f225b507..48429ca19 100644 --- a/js/fetch.ts +++ b/js/fetch.ts @@ -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> { |
