1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Minor tweak for RetrieveETag (#3257)

Need to check if the server responses a null value for ETag.
(In the case testing with build-in webdav server of CarotDAV on Windows 10)
This commit is contained in:
Bram Chen 2018-05-05 18:40:41 +08:00 committed by Jeremy Ruston
parent d4b4c3c936
commit f9be417204

View File

@ -25,8 +25,9 @@ var RetrieveETag = function(self) {
type: "HEAD", type: "HEAD",
headers: headers, headers: headers,
callback: function(err, data, xhr) { callback: function(err, data, xhr) {
if(!err) { var etag = xhr.getResponseHeader("ETag");
self.etag = xhr.getResponseHeader("ETag").replace(/^W\//,""); if(!err && etag) {
self.etag = etag.replace(/^W\//,"");
} }
} }
}); });