X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fhttpstream.lua;h=bdc3fce776c45827ffdf7cd533d7df69dc1a4cdc;hb=492c253d150aeb7edb6687eb9bf085be6c33133a;hp=4b5060a1a6835e1303a463af5d2a9d0d8474c636;hpb=9140b090989d56bb183e9ac660494b1867ccb0ef;p=prosody.git diff --git a/util/httpstream.lua b/util/httpstream.lua index 4b5060a1..bdc3fce7 100644 --- a/util/httpstream.lua +++ b/util/httpstream.lua @@ -46,7 +46,7 @@ local function parser(success_cb, parser_type, options_cb) local status_line = readline(); local method, path, httpversion = status_line:match("^(%S+)%s+(%S+)%s+HTTP/(%S+)$"); if not method then coroutine.yield("invalid-status-line"); end - -- TODO parse url + path = path:gsub("^//+", "/"); -- TODO parse url more local headers = readheaders(); -- read body @@ -104,9 +104,12 @@ local function parser(success_cb, parser_type, options_cb) success_cb({ code = status_code; + httpversion = httpversion; + headers = headers; + body = body; + -- COMPAT the properties below are deprecated responseversion = httpversion; responseheaders = headers; - body = body; }); end else coroutine.yield("unknown-parser-type"); end