web/views/staticcontrollers.py
branchstable
changeset 9233 7d3316bfa4ff
parent 9229 739ae5366bed
child 9234 ce504d23edf7
--- a/web/views/staticcontrollers.py	Mon Sep 16 10:59:59 2013 +0200
+++ b/web/views/staticcontrollers.py	Thu Sep 19 18:03:09 2013 +0200
@@ -199,7 +199,12 @@
             filepath = self.concat_files_registry.concat_cached_filepath(paths)
         else:
             # skip leading '/data/' and url params
-            relpath = relpath[len(self.base_datapath):].split('?', 1)[0]
+            if relpath.startswith(self.base_datapath):
+                prefix = self.base_datapath
+            else:
+                prefix = 'data/'
+            relpath = relpath[len(prefix):]
+            relpath = relpath.split('?', 1)[0]
             dirpath, rid = config.locate_resource(relpath)
             if dirpath is None:
                 raise NotFound()