util.httpstream: A little cleanup of the HTTP path.
authorWaqas Hussain <waqas20@gmail.com>
Sun, 19 Dec 2010 20:27:13 +0500
changeset 3902 a34333fcae72
parent 3901 4447c651e6e6
child 3903 5924197aa163
util.httpstream: A little cleanup of the HTTP path.
util/httpstream.lua
--- a/util/httpstream.lua	Sun Dec 19 03:04:42 2010 +0000
+++ b/util/httpstream.lua	Sun Dec 19 20:27:13 2010 +0500
@@ -46,7 +46,7 @@
 			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