com.jimuwd.xian.registry-proxy 1.0.46 → 1.0.47
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 +2 -2
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -203,12 +203,12 @@ async function writeSuccessfulResponse(registryInfo, targetUrl, res, response, r
|
|
|
203
203
|
}
|
|
204
204
|
else {
|
|
205
205
|
// 二进制流处理
|
|
206
|
-
res.writeHead(response.status, safeHeaders);
|
|
207
206
|
if (!response.body) {
|
|
208
207
|
console.error(`Empty response body from ${targetUrl}`);
|
|
208
|
+
res.writeHead(response.status, safeHeaders).end();
|
|
209
209
|
}
|
|
210
210
|
else {
|
|
211
|
-
res.
|
|
211
|
+
res.writeHead(response.status, safeHeaders).end(response.body);
|
|
212
212
|
/*await pipeline(response.body, res).finally(() => res.end());*/
|
|
213
213
|
}
|
|
214
214
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -270,11 +270,11 @@ async function writeSuccessfulResponse(
|
|
|
270
270
|
res.end(JSON.stringify(data));
|
|
271
271
|
} else {
|
|
272
272
|
// 二进制流处理
|
|
273
|
-
res.writeHead(response.status, safeHeaders);
|
|
274
273
|
if (!response.body) {
|
|
275
274
|
console.error(`Empty response body from ${targetUrl}`);
|
|
275
|
+
res.writeHead(response.status, safeHeaders).end();
|
|
276
276
|
} else {
|
|
277
|
-
res.
|
|
277
|
+
res.writeHead(response.status, safeHeaders).end(response.body)
|
|
278
278
|
/*await pipeline(response.body, res).finally(() => res.end());*/
|
|
279
279
|
}
|
|
280
280
|
}
|