You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I printed the response data in the onProxy function and it was also truncated. In fact, the event proxy.on('end') has no reaction. This problem only occurs in the development environment.
`
proxy.on("proxyRes", function (proxyRes, req, res) {
console.log(req.url.includes("base-config"));
// if (req.url.includes("base-config")) {
let originalBody = new Buffer.from([]);
proxyRes.on("data", function (chunk) {
originalBody = Buffer.concat([originalBody, chunk]);
});
proxyRes.on("end", function () {
console.log(originalBody.toString());
res.end(originalBody.toString())
});
// }
[});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I printed the response data in the onProxy function and it was also truncated. In fact, the event proxy.on('end') has no reaction. This problem only occurs in the development environment.
`
proxy.on("proxyRes", function (proxyRes, req, res) { console.log(req.url.includes("base-config")); // if (req.url.includes("base-config")) { let originalBody = new Buffer.from([]); proxyRes.on("data", function (chunk) { originalBody = Buffer.concat([originalBody, chunk]); }); proxyRes.on("end", function () { console.log(originalBody.toString()); res.end(originalBody.toString()) }); // } [});`]Beta Was this translation helpful? Give feedback.
All reactions