Skip to content

Commit

Permalink
http: fix Host and chunking
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Phillips committed Aug 29, 2012
1 parent 6727d4f commit cc715a4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/luvit/http.lua
Expand Up @@ -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
Expand Down

0 comments on commit cc715a4

Please sign in to comment.