File tree
Expand file treeCollapse file tree1 file changed
+4
-4
lines changed Expand file treeCollapse file tree1 file changed
+4
-4
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -501,12 +501,12 @@ data.
|
501 | 501 | selfHandleResponse : true
|
502 | 502 | };
|
503 | 503 | proxy.on('proxyRes', function (proxyRes, req, res) {
|
504 |
| -var body = new Buffer(''); |
505 |
| -proxyRes.on('data', function (data) { |
506 |
| -body = Buffer.concat([body, data]); |
| 504 | +var body = []; |
| 505 | +proxyRes.on('data', function (chunk) { |
| 506 | +body.push(chunk); |
507 | 507 | });
|
508 | 508 | proxyRes.on('end', function () {
|
509 |
| -body = body.toString(); |
| 509 | +body = Buffer.concat(body).toString(); |
510 | 510 | console.log("res from proxied server:", body);
|
511 | 511 | res.end("my response to cli");
|
512 | 512 | });
|
|
You can’t perform that action at this time.
0 commit comments