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
in request.js, it will add headers to dest stream if it supports setHeader() method:
// here, if koa-logger is used, dest.setHeader is undefined.
if (dest.setHeader && !dest.headersSent) {
for (var i in response.headers) {
// If the response content is being decoded, the Content-Encoding header
// of the response doesn't represent the piped content, so don't pass it.
if (!self.gzip || i !== 'content-encoding') {
dest.setHeader(i, response.headers[i])
}
}
dest.statusCode = response.statusCode
}
so, if we use ctx.body = request() and request() returns a stream, the headers from request() stream are lost.
The text was updated successfully, but these errors were encountered:
TooBug
added a commit
to TooBug/logger
that referenced
this issue
Apr 27, 2021
in koa-logger, it replaces ctx.body with a Counter:
in request.js, it will add headers to dest stream if it supports
setHeader()
method:so, if we use
ctx.body = request()
andrequest()
returns a stream, the headers fromrequest()
stream are lost.The text was updated successfully, but these errors were encountered: