diff --git a/lualib/http/httpc.lua b/lualib/http/httpc.lua index e3a63070..78cab15e 100644 --- a/lualib/http/httpc.lua +++ b/lualib/http/httpc.lua @@ -114,10 +114,8 @@ function httpc.request(method, hostname, url, recvheader, header, content) close_interface(interface, fd) if ok then return statuscode, body - elseif statuscode == 200 then - error(body) else - error(statuscode) + error(body or statuscode) end end