com.jimuwd.xian.registry-proxy 1.0.103 → 1.0.104
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 +4 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -221,7 +221,10 @@ async function writeResponseToDownstreamClient(registryInfo, targetUrl, resToDow
|
|
|
221
221
|
resToDownstreamClient.removeHeader('content-type');
|
|
222
222
|
resToDownstreamClient.setHeader('content-type', contentType);
|
|
223
223
|
logger.info(`Response to downstream client headers`, JSON.stringify(resToDownstreamClient.getHeaders()), targetUrl);
|
|
224
|
-
|
|
224
|
+
// 不再writeHead()而是设置状态码,然后执行pipe操作
|
|
225
|
+
resToDownstreamClient.statusCode = upstreamResponse.status;
|
|
226
|
+
resToDownstreamClient.statusMessage = upstreamResponse.statusText;
|
|
227
|
+
// resToDownstreamClient.writeHead(upstreamResponse.status);
|
|
225
228
|
// stop pipe when req from client is closed accidentally.
|
|
226
229
|
const cleanup = () => {
|
|
227
230
|
reqFromDownstreamClient.off('close', cleanup);
|