We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53a0de6 commit fee368cCopy full SHA for fee368c
lib/resty/http.lua
@@ -706,10 +706,13 @@ end
706
707
function _M.get_client_body_reader(self, chunksize)
708
local chunksize = chunksize or 65536
709
- local ok, sock = pcall(ngx_req_socket)
+ local ok, sock, err = pcall(ngx_req_socket)
710
711
if not ok then
712
- local err = sock
+ return nil, sock -- pcall err
713
+ end
714
+
715
+ if not sock then
716
if err == "no body" then
717
return nil
718
else
@@ -742,6 +745,11 @@ end
742
745
743
746
744
747
function _M.proxy_response(self, response, chunksize)
748
+ if not response then
749
+ ngx_log(ngx_ERR, "no response provided")
750
+ return
751
752
753
ngx.status = response.status
754
755
-- Filter out hop-by-hop headeres
0 commit comments