diff options
Diffstat (limited to 'src/http.lua')
| -rw-r--r-- | src/http.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http.lua b/src/http.lua index e93003d..259eb2b 100644 --- a/src/http.lua +++ b/src/http.lua | |||
| @@ -54,7 +54,7 @@ local function receiveheaders(sock, headers) | |||
| 54 | while line ~= "" do | 54 | while line ~= "" do |
| 55 | -- get field-name and value | 55 | -- get field-name and value |
| 56 | name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)")) | 56 | name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)")) |
| 57 | if not (name and value) then return nil, "malformed reponse headers" end | 57 | if not (name and value) then return nil, "malformed response headers" end |
| 58 | name = string.lower(name) | 58 | name = string.lower(name) |
| 59 | -- get next line (value might be folded) | 59 | -- get next line (value might be folded) |
| 60 | line, err = sock:receive() | 60 | line, err = sock:receive() |
| @@ -81,7 +81,7 @@ socket.sourcet["http-chunked"] = function(sock, headers) | |||
| 81 | dirty = function() return sock:dirty() end | 81 | dirty = function() return sock:dirty() end |
| 82 | }, { | 82 | }, { |
| 83 | __call = function() | 83 | __call = function() |
| 84 | -- get chunk size, skip extention | 84 | -- get chunk size, skip extension |
| 85 | local line, err = sock:receive() | 85 | local line, err = sock:receive() |
| 86 | if err then return nil, err end | 86 | if err then return nil, err end |
| 87 | local size = base.tonumber(string.gsub(line, ";.*", ""), 16) | 87 | local size = base.tonumber(string.gsub(line, ";.*", ""), 16) |
| @@ -281,7 +281,7 @@ local function adjustrequest(reqt) | |||
| 281 | if not (host and host ~= "") then | 281 | if not (host and host ~= "") then |
| 282 | socket.try(nil, "invalid host '" .. base.tostring(nreqt.host) .. "'") | 282 | socket.try(nil, "invalid host '" .. base.tostring(nreqt.host) .. "'") |
| 283 | end | 283 | end |
| 284 | -- compute uri if user hasn't overriden | 284 | -- compute uri if user hasn't overridden |
| 285 | nreqt.uri = reqt.uri or adjusturi(nreqt) | 285 | nreqt.uri = reqt.uri or adjusturi(nreqt) |
| 286 | -- adjust headers in request | 286 | -- adjust headers in request |
| 287 | nreqt.headers = adjustheaders(nreqt) | 287 | nreqt.headers = adjustheaders(nreqt) |
