mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🐛 Fix media proxy having incorrect headers
This commit is contained in:
parent
ead34b818f
commit
550e8977cf
|
|
@ -1,5 +1,5 @@
|
|||
import { apiRoute, applyConfig } from "@api";
|
||||
import { errorResponse, response } from "@response";
|
||||
import { response } from "@response";
|
||||
import { z } from "zod";
|
||||
|
||||
export const meta = applyConfig({
|
||||
|
|
@ -22,6 +22,8 @@ export default apiRoute<typeof meta, typeof schema>(
|
|||
async (req, matchedRoute, extraData) => {
|
||||
const { url } = extraData.parsedRequest;
|
||||
|
||||
return fetch(url);
|
||||
return fetch(url).then((res) => {
|
||||
return response(res.body, res.status, res.headers.toJSON());
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue