diff options
| author | Pierre Chapuis <catwell-github@catwell.info> | 2013-08-14 14:41:57 +0200 |
|---|---|---|
| committer | Pierre Chapuis <catwell-github@catwell.info> | 2013-08-14 14:41:57 +0200 |
| commit | 87d72dce4e76807b28b7c90e93d4b1645ea0af46 (patch) | |
| tree | 35c7b0a1e0d198442e895512e26b727b151160da | |
| parent | 6bdb00e24ca88f271774c2102f631e70f04b249d (diff) | |
| download | luasocket-87d72dce4e76807b28b7c90e93d4b1645ea0af46.tar.gz luasocket-87d72dce4e76807b28b7c90e93d4b1645ea0af46.tar.bz2 luasocket-87d72dce4e76807b28b7c90e93d4b1645ea0af46.zip | |
include port in default Host header
See RFC 2616 section 14.23.
| -rw-r--r-- | src/http.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/http.lua b/src/http.lua index f83dcc5..1d0eb50 100644 --- a/src/http.lua +++ b/src/http.lua | |||
| @@ -209,9 +209,11 @@ end | |||
| 209 | 209 | ||
| 210 | local function adjustheaders(reqt) | 210 | local function adjustheaders(reqt) |
| 211 | -- default headers | 211 | -- default headers |
| 212 | local host = reqt.host | ||
| 213 | if reqt.port then host = host .. ":" .. reqt.port end | ||
| 212 | local lower = { | 214 | local lower = { |
| 213 | ["user-agent"] = _M.USERAGENT, | 215 | ["user-agent"] = _M.USERAGENT, |
| 214 | ["host"] = reqt.host, | 216 | ["host"] = host, |
| 215 | ["connection"] = "close, TE", | 217 | ["connection"] = "close, TE", |
| 216 | ["te"] = "trailers" | 218 | ["te"] = "trailers" |
| 217 | } | 219 | } |
