httpclient: Send the correct Host-Header if we are following a redirect
authorSteven Barth <steven@midlink.org>
Thu, 30 Apr 2009 12:58:04 +0000 (12:58 +0000)
committerSteven Barth <steven@midlink.org>
Thu, 30 Apr 2009 12:58:04 +0000 (12:58 +0000)
libs/httpclient/luasrc/httpclient.lua

index 4f955931037df3f3c6dd8969b843a56dcbb0a3ee..69abddff327ea5a92f82a8386e3598a713bc511a 100644 (file)
@@ -303,6 +303,9 @@ function request_raw(uri, options)
                        end
                        
                        options.depth = options.depth - 1
+                       if options.headers then
+                               options.headers.Host = nil
+                       end
                        sock:close()
                        
                        return request_raw(nuri, options)