diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2018-04-25 21:33:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-25 21:33:38 +0200 |
commit | 0c1a1269004ac4cb4c9b6e14539e40c4a3b70b36 (patch) | |
tree | 5d564355b35f152aa3172550cf6940e5c5baa133 | |
parent | d1c59883c35bb083d4db322bb1b0fcf7e960d611 (diff) | |
parent | 90910247a1427975a42025e541012ca7eb781757 (diff) |
Merge pull request #549 from phillipp/master
Fix "412 precondition failed" when response has no ETag, but OC-ETag …
-rw-r--r-- | js/services/contact_service.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/services/contact_service.js b/js/services/contact_service.js index e0a34f41..62a16d29 100644 --- a/js/services/contact_service.js +++ b/js/services/contact_service.js @@ -234,7 +234,7 @@ angular.module('contactsApp') filename: newUid + '.vcf' } ).then(function(xhr) { - newContact.setETag(xhr.getResponseHeader('ETag')); + newContact.setETag(xhr.getResponseHeader('OC-ETag') || xhr.getResponseHeader('ETag')); contactsCache.put(newUid, newContact); AddressBookService.addContact(addressBook, newContact); if (fromImport !== true) { @@ -329,7 +329,7 @@ angular.module('contactsApp') // update contact on server return DavClient.updateCard(contact.data, {json: true}).then(function(xhr) { - var newEtag = xhr.getResponseHeader('ETag'); + var newEtag = xhr.getResponseHeader('OC-ETag') || xhr.getResponseHeader('ETag'); contact.setETag(newEtag); notifyObservers('update', contact.uid()); }).catch(function() { |