Hello,
Is it possible to generate the Content-Length header in header_filter_by_lua ?
How to get the exact size of the response body like the following example?
thanks,
location = /now {
chunked_transfer_encoding off;
content_by_lua_block {
local buf = ngx.now()
--ngx.header["Content-Length"] = #tostring(buf)
ngx.print( buf )
}
header_filter_by_lua_block {
ngx.header["Content-Length"] = nil
}
}