Skip to content

July 24, 2024

Choose a tag to compare

@theguild-bot theguild-bot released this 24 Jul 16:56
· 1647 commits to master since this release
57e0486

@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 compression

    When the client provides Accept-Encoding header, 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-Encoding header, 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 Type status code.

    serverAdapter's fetch function 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()]
    })