diff --git a/project/src/servers/http/AkiHttpListener.ts b/project/src/servers/http/AkiHttpListener.ts index 315f5a22..34913e49 100644 --- a/project/src/servers/http/AkiHttpListener.ts +++ b/project/src/servers/http/AkiHttpListener.ts @@ -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); }