Software /
code /
prosody
Comparison
net/http/parser.lua @ 5322:8d525f58f916
net.http.parser: Fix traceback on invalid URL in status line.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 08 Feb 2013 00:18:40 +0500 |
parent | 5291:01f7522049fb |
child | 5323:4c30f638ff55 |
comparison
equal
deleted
inserted
replaced
5320:518d864b2ab8 | 5322:8d525f58f916 |
---|---|
97 local _path, _query = path:match("([^?]*).?(.*)"); | 97 local _path, _query = path:match("([^?]*).?(.*)"); |
98 if _query == "" then _query = nil; end | 98 if _query == "" then _query = nil; end |
99 parsed_url = { path = _path, query = _query }; | 99 parsed_url = { path = _path, query = _query }; |
100 else | 100 else |
101 parsed_url = url_parse(path); | 101 parsed_url = url_parse(path); |
102 if not parsed_url then error = true; return error_cb("invalid-url"); end | |
102 end | 103 end |
103 path = preprocess_path(parsed_url.path); | 104 path = preprocess_path(parsed_url.path); |
104 headers.host = parsed_url.host or headers.host; | 105 headers.host = parsed_url.host or headers.host; |
105 | 106 |
106 len = len or 0; | 107 len = len or 0; |