mirror of
https://github.com/versia-pub/server.git
synced 2026-01-26 04:06:01 +01:00
fix(api): 🐛 (hopefully) fix some media not being decoded well on proxy
This commit is contained in:
parent
f4af0e2407
commit
29b98fd1d1
|
|
@ -1,5 +1,5 @@
|
||||||
import { applyConfig, handleZodError } from "@/api";
|
import { applyConfig, handleZodError } from "@/api";
|
||||||
import { errorResponse, response } from "@/response";
|
import { errorResponse } from "@/response";
|
||||||
import { zValidator } from "@hono/zod-validator";
|
import { zValidator } from "@hono/zod-validator";
|
||||||
import type { Hono } from "hono";
|
import type { Hono } from "hono";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
@ -39,12 +39,12 @@ export default (app: Hono) =>
|
||||||
400,
|
400,
|
||||||
);
|
);
|
||||||
|
|
||||||
return fetch(id, {
|
const media = fetch(id, {
|
||||||
headers: {
|
headers: {
|
||||||
"Accept-Encoding": "identity",
|
...context.req.raw.headers,
|
||||||
},
|
},
|
||||||
}).then((res) => {
|
|
||||||
return response(res.body, res.status, res.headers.toJSON());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return media;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue