diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/leap/soledad/server/_blobs.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/src/leap/soledad/server/_blobs.py b/server/src/leap/soledad/server/_blobs.py index 1595a549..44abeb44 100644 --- a/server/src/leap/soledad/server/_blobs.py +++ b/server/src/leap/soledad/server/_blobs.py @@ -157,8 +157,9 @@ class FilesystemBlobsBackend(object): def get_total_storage(self, user): return self._get_disk_usage(self._get_path(user)) - def delete_blob(user, blob_id): - raise NotImplementedError + def delete_blob(self, user, blob_id): + blob_path = self._get_path(user, blob_id) + os.unlink(blob_path) def get_blob_size(user, blob_id): raise NotImplementedError @@ -219,6 +220,12 @@ class BlobsResource(resource.Resource): self._handler.tag_header(user, blob_id, request) return self._handler.read_blob(user, blob_id, request) + def render_DELETE(self, request): + logger.info("http put: %s" % request.path) + user, blob_id = self._validate(request) + self._handler.delete_blob(user, blob_id) + return '' + def render_PUT(self, request): logger.info("http put: %s" % request.path) user, blob_id = self._validate(request) |