From 29b98fd1d175ef3f9b93ad20cb5887e9e1244b32 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Wed, 5 Jun 2024 15:56:40 -1000 Subject: [PATCH] fix(api): :bug: (hopefully) fix some media not being decoded well on proxy --- server/api/media/proxy/:id.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/api/media/proxy/:id.ts b/server/api/media/proxy/:id.ts index 24d468d9..7493f701 100644 --- a/server/api/media/proxy/:id.ts +++ b/server/api/media/proxy/:id.ts @@ -1,5 +1,5 @@ import { applyConfig, handleZodError } from "@/api"; -import { errorResponse, response } from "@/response"; +import { errorResponse } from "@/response"; import { zValidator } from "@hono/zod-validator"; import type { Hono } from "hono"; import { z } from "zod"; @@ -39,12 +39,12 @@ export default (app: Hono) => 400, ); - return fetch(id, { + const media = fetch(id, { headers: { - "Accept-Encoding": "identity", + ...context.req.raw.headers, }, - }).then((res) => { - return response(res.body, res.status, res.headers.toJSON()); }); + + return media; }, );