July 24, 2024
·
1647 commits
to master
since this release
@whatwg-node/node-fetch@0.5.14
Patch Changes
- #1481
481bdfd
Thanks @ardatan! - Send supported encoding formats in
`accept-encoding` header by default
@whatwg-node/server@0.9.37
Patch Changes
-
#1481
481bdfd
Thanks @ardatan! - New plugin to handle E2E request compressionWhen the client provides
Accept-Encodingheader, if the server supports the encoding, it will
compress the response body. This will reduce the size of the response body and improve the
performance of the application.On the other hand, if the client sends
Content-Encodingheader, the server will decompress the
request body before processing it. This will allow the server to handle the request body in its
original form. If the server does not support the encoding, it will respond with
415 Unsupported Media Typestatus code.serverAdapter'sfetchfunction handles the compression and decompression of the request and
response bodies.import { createServerAdapter, Response, useContentEncoding } from '@whatwg-node/server' const serverAdapter = createServerAdapter(() => Response.json({ hello: 'world' }), { plugins: [useContentEncoding()] })