You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BunHttpPlatform: fileWeb ignores the file name when File.type is empty #10870
On Bun, HttpServerResponse.fileWeb with a File that has an empty type is served as text/plain;charset=utf-8, whatever its name. Node, Deno and the default web platform look the type up from the file name (#8254), so the same handler serves data.json as application/json there.
import*asBunHttpPlatformfrom"@effect/platform-bun/BunHttpPlatform"import{Effect}from"effect"import*asHttpPlatformfrom"effect/http/HttpPlatform"Effect.gen(function*(){constplatform=yield*HttpPlatform.HttpPlatformconstresponse=yield*platform.fileWebResponse(newFile(["{}"],"data.json"))console.log(response.headers["content-type"])// undefined, sent as text/plain;charset=utf-8}).pipe(Effect.provide(BunHttpPlatform.layer),Effect.runPromise)
Activity