Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bun sets default content-type for Uint8Array #1158

@huseeiin

Description

@huseeiin

Environment

using h3 v2 directly from repo "./src/index.ts" and bun 1.2.18

Reproduction

import { H3, serve } from "./src/index.ts";

const app = new H3();

app.get("/", (e) => {
  return new TextEncoder().encode("hello");
});

console.log(
  await fetch(serve(app).url!).then((r) => r.headers.get("content-type")),
);

Describe the bug

application/octet-stream is unexpected. when opening in a browser it downloads a file.

Additional context

in node it doesn't download and content-type is null

Logs

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