mirror of
https://github.com/CyberL1/dlinux-dashboard.git
synced 2025-01-22 01:19:18 -05:00
fix(proxy): set content-type
header from proxyRequest
variable
This commit is contained in:
parent
4d661c073c
commit
0af2045548
@ -6,7 +6,7 @@ const app = fastify();
|
|||||||
app.all(
|
app.all(
|
||||||
"/*",
|
"/*",
|
||||||
{ constraints: { host: new RegExp(`.*\.${process.env.PROXY_DOMAIN}`) } },
|
{ constraints: { host: new RegExp(`.*\.${process.env.PROXY_DOMAIN}`) } },
|
||||||
async (req) => {
|
async (req, reply) => {
|
||||||
const subdomains = req.headers.host.split(".");
|
const subdomains = req.headers.host.split(".");
|
||||||
|
|
||||||
const port = subdomains[0].startsWith("port-")
|
const port = subdomains[0].startsWith("port-")
|
||||||
@ -24,6 +24,8 @@ app.all(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const proxyResponse = await proxyRequest.text();
|
const proxyResponse = await proxyRequest.text();
|
||||||
|
reply.header("content-type", proxyRequest.headers.get("content-type"));
|
||||||
|
|
||||||
return proxyResponse;
|
return proxyResponse;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user