Skip to content

Commit ca6f776

Browse files
committed
Fix deflate to closer match httpbin
1 parent c93ca81 commit ca6f776

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/endpoints/http/encoding/deflate.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { HttpEndpoint, HttpHandler } from '../../http-index.js';
55
// We pre-decode the data. Note that this differs from HTTPBin which returns
66
// dynamic data here - for this reason, we use a subdirectory. Dynamic encoding
77
// is relatively expensive so we don't want that. Instead we just use the same
8-
// static data every time, including only a 'deflate' field.
8+
// static data every time, including only a 'deflated' field (which does match
9+
// HTTPBin at least, for that one field).
910
const data = zlib.deflateSync(serializeJson({
10-
deflate: true
11+
deflated: true
1112
}));
1213

1314
const matchPath = (path: string) => path === '/encoding/deflate';

test/encodings.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('Encoding Endpoints', () => {
2727
},
2828
{
2929
name: 'deflate',
30-
expectedJson: { deflate: true }
30+
expectedJson: { deflated: true }
3131
},
3232
{
3333
name: 'brotli',

0 commit comments

Comments
 (0)