libs/httpclient: return server response line in error case (#249)
[project/luci.git] / libs / httpclient / luasrc / httpclient.lua
index aacc79a5bb851cab5832931cfb534968c2f378cf..93eed05c63d4f4c723fdca58b8740a43590efca0 100644 (file)
@@ -92,7 +92,7 @@ function request_to_source(uri, options)
        if not status then
                return status, response, buffer
        elseif status ~= 200 and status ~= 206 then
-               return nil, status, response
+               return nil, status, buffer
        end
        
        if response.headers["Transfer-Encoding"] == "chunked" then