# HG changeset patch # User Waqas Hussain # Date 1356079059 -18000 # Node ID c85c348253bdf8cb6fd3872fc49443b50e90c3ce # Parent b125892e187c7de6ca35868a78b468b49a0da360 net.http.parser: Skip url.parse when we don't have a full URL (also fixes traceback on paths starting with '//'). diff -r b125892e187c -r c85c348253bd net/http/parser.lua --- a/net/http/parser.lua Fri Dec 21 09:04:02 2012 +0100 +++ b/net/http/parser.lua Fri Dec 21 13:37:39 2012 +0500 @@ -91,7 +91,14 @@ responseheaders = headers; }; else - local parsed_url = url_parse(path); + local parsed_url; + if path:byte() == 47 then -- starts with / + local _path, _query = path:match("([^?]*).?(.*)"); + if _query == "" then _query = nil; end + parsed_url = { path = _path, query = _query }; + else + parsed_url = url_parse(path); + end path = preprocess_path(parsed_url.path); headers.host = parsed_url.host or headers.host;