Skip to content

How to use res.send([buffer]) without a content-type? #6223

@jeroen

Description

@jeroen

I refactored my app to use in memory buffers instead of files. However an undesired side effect is that for all responses where we do res.send(buf) without setting an explicit res.type() express now defaults to:

Content-Type: application/octet-stream

I do not want this. Is there a workaround to use res.send(buffer) without setting any content-type automatically?

I know I can explicitly override it with res.type("bla/bla") but for many resources there is not a known type. In these cases I want to set no content-type response header.

I am using express 5.0.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions