From 36183b7c9daa68ca120ef80767f311faba588cc6 Mon Sep 17 00:00:00 2001 From: drebs Date: Sun, 19 Mar 2017 10:16:55 +0100 Subject: [bug] use postpath to get blobs user and id in server --- server/src/leap/soledad/server/_blobs.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'server/src/leap/soledad') diff --git a/server/src/leap/soledad/server/_blobs.py b/server/src/leap/soledad/server/_blobs.py index e90c6672..d5476aae 100644 --- a/server/src/leap/soledad/server/_blobs.py +++ b/server/src/leap/soledad/server/_blobs.py @@ -189,21 +189,15 @@ class BlobsResource(resource.Resource): def render_GET(self, request): logger.info("http get: %s" % request.path) - user, blob_id = self._split_path(request.path) + user, blob_id = request.postpath self._handler.tag_header(user, blob_id, request) return self._handler.read_blob(user, blob_id, request) def render_PUT(self, request): logger.info("http put: %s" % request.path) - user, blob_id = self._split_path(request.path) + user, blob_id = request.postpath return self._handler.write_blob(user, blob_id, request) - def _split_path(self, blob_id): - # FIXME catch errors here - parts = blob_id.split('/') - _, user, blobname = parts - return user, blobname - # provide a configured instance of the resource _config = get_config() -- cgit v1.2.3