diff --git a/project/src/servers/http/AkiHttpListener.ts b/project/src/servers/http/AkiHttpListener.ts index 34913e49..315f5a22 100644 --- a/project/src/servers/http/AkiHttpListener.ts +++ b/project/src/servers/http/AkiHttpListener.ts @@ -64,10 +64,11 @@ 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 compressed = req.method === "PUT" || req.headers.debug !== "1"; + const requestIsCompressed = req.headers.requestcompressed === "1"; + const requestCompressed = req.method === "PUT" || requestIsCompressed; - const value = compressed ? zlib.inflateSync(buffer) : buffer; - if (req.headers.debug === "1") + const value = requestCompressed ? zlib.inflateSync(buffer) : buffer; + if (!requestIsCompressed) { this.logger.debug(value.toString(), true); } @@ -107,7 +108,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.debug === "1") + if (req.headers.responsecompressed === "0") { this.sendJson(resp, output, sessionID); }