-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
v1rtl
committed
Jan 30, 2023
1 parent
40fc7f7
commit b2d2fd6
Showing
3 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { readAll } from 'https://deno.land/std@0.170.0/streams/read_all.ts' | ||
import { readAll } from 'https://deno.land/std@0.175.0/streams/read_all.ts' | ||
import { compress as brotli } from 'https://deno.land/x/[email protected]/mod.ts' | ||
import { Foras, gzip, deflate } from 'https://deno.land/x/[email protected].3/src/deno/mod.ts' | ||
import { Foras } from 'https://deno.land/x/[email protected].6/src/deno/mod.ts' | ||
import { Accepts } from 'https://deno.land/x/[email protected]/mod.ts' | ||
|
||
await Foras.initSyncBundledOnce() | ||
await Foras.initBundledOnce() | ||
|
||
const funcs = { | ||
br: brotli, | ||
gzip: (body: Uint8Array) => gzip(body, undefined), | ||
deflate: (body: Uint8Array) => deflate(body, undefined) | ||
gzip: (body: Uint8Array) => Foras.gzip(body, undefined), | ||
deflate: (body: Uint8Array) => Foras.deflate(body, undefined) | ||
} | ||
|
||
/** | ||
|
@@ -49,7 +49,7 @@ export type CompressionOptions = { | |
* @example | ||
* ```ts | ||
import { compression } from 'https://deno.land/x/http_compression/mod.ts' | ||
import { Server } from 'https://deno.land/std@0.170.0/http/server.ts' | ||
import { Server } from 'https://deno.land/std@0.175.0/http/server.ts' | ||
new Server({ | ||
handler: async (req) => { | ||
|
@@ -96,8 +96,7 @@ export const compression = | |
return new Response(compressed, { | ||
headers: new Headers({ | ||
'Content-Encoding': preferredAlgo | ||
}), | ||
status: 200 | ||
}) | ||
}) | ||
} else { | ||
if (Array.isArray(encodings)) { | ||
|