From 7a5b5fc2b8c3a85045d2dfc25132f865c6274150 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Wed, 17 Sep 2025 17:23:35 +0300 Subject: [PATCH] [bug] Disable response decoding while proxying; Fix bug 76719 --- Common/sources/utils.js | 4 +++- DocService/sources/ai/aiProxyHandler.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Common/sources/utils.js b/Common/sources/utils.js index 4b793354..3c249e56 100644 --- a/Common/sources/utils.js +++ b/Common/sources/utils.js @@ -521,9 +521,10 @@ async function postRequestPromise(ctx, uri, postData, postDataStream, postDataSi * @param {object} opt_timeout - Optional timeout configuration. * @param {number} opt_limit - Optional limit on the size of the response. * @param {boolean} opt_filterPrivate - Optional flag to filter private requests. + * @param {Object} [opt_axiosConfig={}] - Optional additional axios configuration options. * @returns {Promise<{response: axios.AxiosResponse, stream: SizeLimitStream}>} - A promise that resolves to an object containing the raw Axios response and a SizeLimitStream. */ -async function httpRequest(ctx, method, uri, opt_headers, opt_body, opt_timeout, opt_limit, opt_filterPrivate) { +async function httpRequest(ctx, method, uri, opt_headers, opt_body, opt_timeout, opt_limit, opt_filterPrivate, opt_axiosConfig = {}) { const tenTenantRequestDefaults = ctx.getCfg('services.CoAuthoring.requestDefaults', cfgRequestDefaults); uri = URI.serialize(URI.parse(uri)); const options = config.util.cloneDeep(tenTenantRequestDefaults); @@ -548,6 +549,7 @@ async function httpRequest(ctx, method, uri, opt_headers, opt_body, opt_timeout, const axiosConfig = { ...options, + ...opt_axiosConfig, url: uri, method, headers: requestHeaders, diff --git a/DocService/sources/ai/aiProxyHandler.js b/DocService/sources/ai/aiProxyHandler.js index cf40b3ee..ce25be66 100644 --- a/DocService/sources/ai/aiProxyHandler.js +++ b/DocService/sources/ai/aiProxyHandler.js @@ -300,7 +300,10 @@ async function proxyRequest(req, res) { requestParams.body, // Request body requestParams.timeout, // Timeout configuration requestParams.limit, // Size limit - requestParams.isInJwtToken // Filter private requests + requestParams.isInJwtToken, // Filter private requests + { + decompress: false + } ); // Set the response headers to match the target response