Software /
code /
prosody
Comparison
net/http/parser.lua @ 5271:f716a3c58b4b
Merge 0.9->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 26 Dec 2012 20:35:40 +0100 |
parent | 5259:c85c348253bd |
child | 5291:01f7522049fb |
comparison
equal
deleted
inserted
replaced
5258:79bdd093d6ba | 5271:f716a3c58b4b |
---|---|
89 -- COMPAT the properties below are deprecated | 89 -- COMPAT the properties below are deprecated |
90 responseversion = httpversion; | 90 responseversion = httpversion; |
91 responseheaders = headers; | 91 responseheaders = headers; |
92 }; | 92 }; |
93 else | 93 else |
94 local parsed_url = url_parse(path); | 94 local parsed_url; |
95 if path:byte() == 47 then -- starts with / | |
96 local _path, _query = path:match("([^?]*).?(.*)"); | |
97 if _query == "" then _query = nil; end | |
98 parsed_url = { path = _path, query = _query }; | |
99 else | |
100 parsed_url = url_parse(path); | |
101 end | |
95 path = preprocess_path(parsed_url.path); | 102 path = preprocess_path(parsed_url.path); |
96 headers.host = parsed_url.host or headers.host; | 103 headers.host = parsed_url.host or headers.host; |
97 | 104 |
98 len = len or 0; | 105 len = len or 0; |
99 packet = { | 106 packet = { |