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
When requesting the length using ctx.length, Koa parses the content length response header using the double tilde operator: https://github.com/koajs/koa/blob/master/lib/response.js#L214 However, this operation also performs a 32-bit conversion, resulting in incorrect and weird results when serving large files. Isn't it therefore better to use the Math.trunc() function instead to parse the content length response header?
The text was updated successfully, but these errors were encountered:
When requesting the length using
ctx.length
, Koa parses the content length response header using the double tilde operator: https://github.com/koajs/koa/blob/master/lib/response.js#L214 However, this operation also performs a 32-bit conversion, resulting in incorrect and weird results when serving large files. Isn't it therefore better to use theMath.trunc()
function instead to parse the content length response header?The text was updated successfully, but these errors were encountered: