mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-25 01:20:30 +00:00
Fix interpretation of HTTP status codes
This commit is contained in:
parent
9700030d12
commit
3be822f926
@ -74,14 +74,15 @@ HttpClient.prototype.handleHttpRequest = function(event) {
|
||||
headers: requestHeaders,
|
||||
data: paramObject.body,
|
||||
callback: function(err,data,xhr) {
|
||||
var headers = {};
|
||||
var success = (xhr.status >= 200 || xhr.status < 300) ? "complete" : "error",
|
||||
headers = {};
|
||||
$tw.utils.each(xhr.getAllResponseHeaders().split("\r\n"),function(line) {
|
||||
var pos = line.indexOf(":");
|
||||
if(pos !== -1) {
|
||||
headers[line.substr(0,pos)] = line.substr(pos + 1).trim();
|
||||
}
|
||||
});
|
||||
setBinding(bindStatus,xhr.status === 200 ? "complete" : "error");
|
||||
setBinding(bindStatus,success);
|
||||
setBinding(bindProgress,"100");
|
||||
var results = {
|
||||
status: xhr.status.toString(),
|
||||
|
Loading…
Reference in New Issue
Block a user