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 4f95593..69abddf 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)