|
1 | | -import { readAll } from 'https://deno.land/std@0.170.0/streams/read_all.ts' |
| 1 | +import { readAll } from 'https://deno.land/std@0.175.0/streams/read_all.ts' |
2 | 2 | import { compress as brotli } from 'https://deno.land/x/[email protected]/mod.ts' |
3 | | -import { Foras, gzip, deflate } from 'https://deno.land/x/[email protected].3/src/deno/mod.ts' |
| 3 | +import { Foras } from 'https://deno.land/x/[email protected].6/src/deno/mod.ts' |
4 | 4 | import { Accepts } from 'https://deno.land/x/[email protected]/mod.ts' |
5 | 5 |
|
6 | | -await Foras.initSyncBundledOnce() |
| 6 | +await Foras.initBundledOnce() |
7 | 7 |
|
8 | 8 | const funcs = { |
9 | 9 | br: brotli, |
10 | | - gzip: (body: Uint8Array) => gzip(body, undefined), |
11 | | - deflate: (body: Uint8Array) => deflate(body, undefined) |
| 10 | + gzip: (body: Uint8Array) => Foras.gzip(body, undefined), |
| 11 | + deflate: (body: Uint8Array) => Foras.deflate(body, undefined) |
12 | 12 | } |
13 | 13 |
|
14 | 14 | /** |
@@ -49,7 +49,7 @@ export type CompressionOptions = { |
49 | 49 | * @example |
50 | 50 | * ```ts |
51 | 51 | import { compression } from 'https://deno.land/x/http_compression/mod.ts' |
52 | | -import { Server } from 'https://deno.land/std@0.170.0/http/server.ts' |
| 52 | +import { Server } from 'https://deno.land/std@0.175.0/http/server.ts' |
53 | 53 |
|
54 | 54 | new Server({ |
55 | 55 | handler: async (req) => { |
@@ -96,8 +96,7 @@ export const compression = |
96 | 96 | return new Response(compressed, { |
97 | 97 | headers: new Headers({ |
98 | 98 | 'Content-Encoding': preferredAlgo |
99 | | - }), |
100 | | - status: 200 |
| 99 | + }) |
101 | 100 | }) |
102 | 101 | } else { |
103 | 102 | if (Array.isArray(encodings)) { |
|
0 commit comments