mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
TiddlyWebAdaptor: Don't crash if "etag" header is missing
This commit is contained in:
parent
fecf622616
commit
e96a54c753
@ -197,11 +197,16 @@ TiddlyWebAdaptor.prototype.saveTiddler = function(tiddler,callback) {
|
|||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
// Save the details of the new revision of the tiddler
|
// Save the details of the new revision of the tiddler
|
||||||
var etagInfo = self.parseEtag(request.getResponseHeader("Etag"));
|
var etag = request.getResponseHeader("Etag");
|
||||||
// Invoke the callback
|
if(!etag) {
|
||||||
callback(null,{
|
callback("Response from server is missing required `etag` header");
|
||||||
bag: etagInfo.bag
|
} else {
|
||||||
}, etagInfo.revision);
|
var etagInfo = self.parseEtag(etag);
|
||||||
|
// Invoke the callback
|
||||||
|
callback(null,{
|
||||||
|
bag: etagInfo.bag
|
||||||
|
}, etagInfo.revision);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user