0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 02:10:44 -05:00

Revert "Split out debug heading into 2 headers, one each for request/response"

This reverts commit e2f3191212c45ce23472aefe2678c9858c9ea32d.
This commit is contained in:
Dev 2024-04-20 14:19:35 +01:00
parent f873edb456
commit 7fd9dadb13

View File

@ -64,11 +64,10 @@ export class AkiHttpListener implements IHttpListener
// determine if the payload is compressed. All PUT requests are, and POST requests without
// debug = 1 are as well. This should be fixed.
// let compressed = req.headers["content-encoding"] === "deflate";
const requestIsCompressed = req.headers.requestcompressed === "1";
const requestCompressed = req.method === "PUT" || requestIsCompressed;
const compressed = req.method === "PUT" || req.headers.debug !== "1";
const value = requestCompressed ? zlib.inflateSync(buffer) : buffer;
if (!requestIsCompressed)
const value = compressed ? zlib.inflateSync(buffer) : buffer;
if (req.headers.debug === "1")
{
this.logger.debug(value.toString(), true);
}
@ -108,7 +107,7 @@ export class AkiHttpListener implements IHttpListener
let handled = false;
// Check if this is a debug request, if so just send the raw response without transformation
if (req.headers.responsecompressed === "0")
if (req.headers.debug === "1")
{
this.sendJson(resp, output, sessionID);
}