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,12 +197,17 @@ TiddlyWebAdaptor.prototype.saveTiddler = function(tiddler,callback) {
|
||||
return callback(err);
|
||||
}
|
||||
// Save the details of the new revision of the tiddler
|
||||
var etagInfo = self.parseEtag(request.getResponseHeader("Etag"));
|
||||
var etag = request.getResponseHeader("Etag");
|
||||
if(!etag) {
|
||||
callback("Response from server is missing required `etag` header");
|
||||
} else {
|
||||
var etagInfo = self.parseEtag(etag);
|
||||
// Invoke the callback
|
||||
callback(null,{
|
||||
bag: etagInfo.bag
|
||||
}, etagInfo.revision);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user