Skip to content

Commit a31e5b6

Browse files
committed
Add utf8 as another no-op encoding
1 parent 5307729 commit a31e5b6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The supported codecs are:
1212
* Brotli
1313
* Zstandard
1414

15-
All encoding names are case-insensitive (although lowercase is generally standard). The 'identity', 'amz-1.0', 'none', 'text', 'binary' and 'utf-8' encodings (no-op encodings) are all supported as no-op encodings, passed through with no en/decoding at all. Only 'identity' is standard, but the others are all in common use regardless.
15+
All encoding names are case-insensitive (although lowercase is generally standard). The 'identity', 'amz-1.0', 'none', 'text', 'binary', 'utf8' and 'utf-8' encodings are all supported as no-op encodings, passed through with no en/decoding at all. Only 'identity' is standard, but the others are all in common use regardless.
1616

1717
Found a codec used in real-world HTTP that isn't supported? Open an issue!
1818

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ export type SUPPORTED_ENCODING =
99
| 'deflate'
1010
| 'x-deflate'
1111
| 'br'
12-
| 'zstd'
13-
| 'amz-1.0';
12+
| 'zstd';
1413

1514
export const gzip = promisify(zlib.gzip);
1615
export const gunzip = promisify(zlib.gunzip);
@@ -89,10 +88,11 @@ const IDENTITY_ENCODINGS = [
8988
// Workaround for Apache's mod_deflate handling of 'identity', used in the wild mostly with PHP.
9089
// https://github.com/curl/curl/pull/2298
9190
'none',
92-
// No idea where these comes from, but they definitely exist in real traffic and seem to come
91+
// No idea where these come from, but they definitely exist in real traffic and seem to come
9392
// from common confusion between content encodings and content types:
9493
'text',
9594
'binary',
95+
'utf8',
9696
'utf-8'
9797
]
9898

0 commit comments

Comments
 (0)