com.jimuwd.xian.registry-proxy 1.0.92 → 1.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -205,8 +205,10 @@ async function writeResponseToDownstreamClient(registryInfo, targetUrl, resToDow
|
|
|
205
205
|
}
|
|
206
206
|
const bodyData = JSON.stringify(data);
|
|
207
207
|
const safeHeaders = { 'content-type': contentType, 'content-length': Buffer.byteLength(bodyData) };
|
|
208
|
+
// resToDownstreamClient.removeHeader('Transfer-Encoding');
|
|
209
|
+
// resToDownstreamClient.setHeader('content-type','application/json');
|
|
208
210
|
logger.info(`Response to downstream client headers`, JSON.stringify(safeHeaders), targetUrl);
|
|
209
|
-
resToDownstreamClient.writeHead(upstreamResponse.status,
|
|
211
|
+
resToDownstreamClient.writeHead(upstreamResponse.status, safeHeaders).end(bodyData);
|
|
210
212
|
}
|
|
211
213
|
else if (contentType.includes('application/octet-stream')) { // 二进制流处理
|
|
212
214
|
logger.info("Write application/octet-stream response from upstream to downstream", targetUrl);
|