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;
- responseversion = httpversion;
- responseheaders = headers;
+ httpversion = httpversion;
+ headers = headers;
body = body;
});
end