lua-resty-http
lua-resty-http copied to clipboard
request_uri() lost Trailer?
https://github.com/ledgetech/lua-resty-http/blob/2af9925acf5cbb5b387539cd4463552ebbd5efee/lib/resty/http.lua#L937-L950
In function request_uri(), we read response body by res:read_body(), but Trailer is not be read before closing connection I think.
Correct me if I am wrong~
Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer
Yes, it looks like with the "single shot" interface (request_uri
) we don't read the trailers. I don't remember if there was a reason for this or not, but perhaps it is simply an oversight.
With the generic interface you just need to call res:read_trailers()
after reading the body.
PRs welcome :)