Skip to content

hono/lambda-edge adapter should treat compressed response body as binary #4254

Description

@vinsonchuong

const isBase64Encoded = isContentTypeBinary(res.headers.get('content-type') || '')
const body = isBase64Encoded ? encodeBase64(await res.arrayBuffer()) : await res.text()

When I use the hono/lambda-edge adapter with the hono/compress middleware, no response body is returned. This is because the gzipped response isn't being Base64-encoded by the adapter.

The above lines of code should look at the Content-Encoding header to detect a compressed response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions