util.pluginloader: Return full file path from internal file loader on success, not...
[prosody.git] / util / httpstream.lua
index 4b5060a1a6835e1303a463af5d2a9d0d8474c636..bdc3fce776c45827ffdf7cd533d7df69dc1a4cdc 100644 (file)
@@ -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