util.httpstream: A little cleanup of the HTTP path.
authorWaqas Hussain <waqas20@gmail.com>
Sun, 19 Dec 2010 15:27:13 +0000 (20:27 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Sun, 19 Dec 2010 15:27:13 +0000 (20:27 +0500)
util/httpstream.lua

index 4b5060a1a6835e1303a463af5d2a9d0d8474c636..c9f2f691627c7d03478a7f7b5f3b9954ed848632 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