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
There isn't a way natively to do it that I know of. Bao uses the Bun Response type so you would have to use that to calculate it. Off the top of my head, I'd probably enumerate the headers to calculate their length, add the response length (e.g. array buffer, text, etc.), and then add the status line length. I might be missing something else but that's the gist of it. If that doesn't work, you could try using a reverse proxy to read its exact length?
I see what you mean but because the server is computing the Content-length header somewhere, I thought it might be possible to get this header as well.
In a middleware, is there a way to get the size of the response
ctx.res
sent to the client?The text was updated successfully, but these errors were encountered: