All of the changes that have been sitting on tildepi for ages. For posterity.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3530 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2020-09-23 01:58:13 +00:00
parent d6018736d5
commit d293637741
29 changed files with 3380 additions and 8 deletions

View File

@ -23,6 +23,7 @@ function parseUrl(url) {
function parseResponse(data) {
var firstLine;
var headers = {};
var headerArray = [];
while (true) {
var endLine = data.indexOf("\r\n");
@ -33,11 +34,14 @@ function parseResponse(data) {
break;
} else {
var colon = line.indexOf(":");
headers[line.substring(0, colon).toLowerCase()] = line.substring(colon + 1).trim();
var key = line.substring(0, colon);
var value = line.substring(colon + 1).trim();
headers[key.toLowerCase()] = value;
headerArray.push([key, value]);
}
data = data.substring(endLine + 2);
}
return {body: data, headers: headers};
return {body: data, headers: headers, headerArray: headerArray};
}
function get(url) {