add docker
This commit is contained in:
@ -9,6 +9,7 @@ export default class ProxyRoute extends Route {
|
||||
}
|
||||
|
||||
async handle(req: Request, res: Response) {
|
||||
const before = Date.now();
|
||||
const json = req.body;
|
||||
const secret = json.secret;
|
||||
if (!secret) {
|
||||
@ -49,6 +50,13 @@ export default class ProxyRoute extends Route {
|
||||
delete headers["cf-ray"];
|
||||
delete headers["alt-svc"];
|
||||
|
||||
// Misc headers
|
||||
delete headers["transfer-encoding"];
|
||||
|
||||
// Add node specific headers
|
||||
headers["x-proxy-node"] = process.env.NODE_ID;
|
||||
headers["x-proxy-response-time"] = Date.now() - before + "ms";
|
||||
|
||||
// Return the JSON response
|
||||
res.status(response.status).set(headers).json(data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user