com.jimuwd.xian.registry-proxy 1.0.94 → 1.0.95
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 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -205,6 +205,9 @@ async function writeResponseToDownstreamClient(registryInfo, targetUrl, resToDow
|
|
|
205
205
|
}
|
|
206
206
|
const bodyData = JSON.stringify(data);
|
|
207
207
|
resToDownstreamClient.removeHeader('Transfer-Encoding');
|
|
208
|
+
// 默认是 connection: keep-alive 和 keep-alive: timeout=5,这里直接给它咔嚓掉
|
|
209
|
+
resToDownstreamClient.setHeader('Connection', 'close');
|
|
210
|
+
resToDownstreamClient.removeHeader('Keep-Alive');
|
|
208
211
|
resToDownstreamClient.setHeader('content-type', 'application/json');
|
|
209
212
|
resToDownstreamClient.setHeader('content-length', Buffer.byteLength(bodyData));
|
|
210
213
|
logger.info(`Response to downstream client headers`, JSON.stringify(resToDownstreamClient.getHeaders()), targetUrl);
|