forked from cory/tildefriends
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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user