1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-20 00:34:50 +00:00
TiddlyWiki5/core/modules/savers
FND 6505e6f448 WebDAV file overwrite protection (#2614)
* putSaver: detect edit conflicts to prevent clobbering, if possible

if the server supplies an ETag, we send it back when saving, allowing
the server to detect edit conflicts and respond with 412 (cf.
https://www.w3.org/1999/04/Editing/)

caveats:
* this only kicks in after the first save, as we don't have access to
  the ETag when first loading the document
* there's no recovery mechanism (e.g. resetting `this.etag` in order to
  force clobbering), other than manually reloading the document

* putSaver: retrieve ETag upon initialization for clobbering protection

this addresses one of the caveats from the previous commit
(2d75cb83af) - while theoretically prone
to a race condition, it seems unlikely that saving will be triggered
before the server responds

* putSaver: simplify URI extraction

this simplifies the approach introduced in
f51f6bf774, with the purpose of removing
the fragment identifier

* putSaver: localize error message

* putSaver: switch to built-in HTTP helper

in the process, fixed ETag assignment in `#save` method (was
`this.etag`, now `self.etag`) as well as a syntax error due to a missing
closing brace

* putSaver: consolidate URI handling
2017-02-17 12:26:15 +00:00
..
andtidwiki.js Obeisance to JSHint for core modules 2014-08-30 20:44:26 +01:00
beaker.js Fix problem with beaker saver and default index pages 2016-12-29 16:45:47 +00:00
download.js Adds support for autosave with the download saver 2017-01-30 18:19:28 +00:00
fsosaver.js Ensure that savers invoke the callback 2014-08-27 09:59:01 +01:00
manualdownload.js Ensure that savers invoke the callback 2014-08-27 09:59:01 +01:00
msdownload.js Ensure that savers invoke the callback 2014-08-27 09:59:01 +01:00
put.js WebDAV file overwrite protection (#2614) 2017-02-17 12:26:15 +00:00
tiddlyfox.js TiddlyFox saver canSave() should always return true (#2626) 2016-12-17 15:27:25 +00:00
tiddlyie.js Ensure that savers invoke the callback 2014-08-27 09:59:01 +01:00
twedit.js Add localisable strings for error (#2447) 2016-05-17 21:58:47 +01:00
upload.js Add localisable strings for error (#2447) 2016-05-17 21:58:47 +01:00