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
success_cb({
code = status_code;
+ httpversion = httpversion;
+ headers = headers;
+ body = body;
+ -- COMPAT the properties below are deprecated
responseversion = httpversion;
responseheaders = headers;
- body = body;
});
end
else coroutine.yield("unknown-parser-type"); end