Skip to content
Permalink
Browse files

http: fix Host and chunking

  • Loading branch information...
Ryan Phillips
Ryan Phillips committed Aug 29, 2012
1 parent 6727d4f commit cc715a448eed75005aee2aff6a3589b84a000dd5
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/luvit/http.lua
@@ -627,17 +627,17 @@ function ClientRequest:initialize(options, callback)
for k, v in pairs(options.headers) do
self:setHeader(k, v)
end
end

if host and not self:getHeader('host') and setHost then
local hostHeader = host
if port and port ~= defaultPort then
hostHeader = hostHeader .. ':' .. port
end
self:setHeader('Host', hostHeader)
if host and not self:getHeader('host') and setHost then
local hostHeader = host
if port and port ~= defaultPort then
hostHeader = hostHeader .. ':' .. port
end
self:setHeader('Host', hostHeader)
end

if method == 'GET' or method == 'HEAD' or method == 'CONNECT' then
if self.method == 'GET' or self.method == 'HEAD' or self.method == 'CONNECT' then
self.useChunkedEncodingByDefault = false
else
self.useChunkedEncodingByDefault = true

0 comments on commit cc715a4

Please sign in to comment.
You can’t perform that action at this time.