# HG changeset patch # User Florent Cayré # Date 1334743291 -7200 # Node ID 94f26e3b09bf9338cbc9794f0692137221d4ef5d # Parent c6c624cea870b71aae4dbe18094cad3526d2709b fix static file serving when url has parameters (like cache busters do) diff -r c6c624cea870 -r 94f26e3b09bf web/views/staticcontrollers.py --- a/web/views/staticcontrollers.py Wed May 09 15:06:43 2012 +0200 +++ b/web/views/staticcontrollers.py Wed Apr 18 12:01:31 2012 +0200 @@ -183,13 +183,14 @@ if relpath.startswith(self.data_modconcat_basepath): paths = relpath[len(self.data_modconcat_basepath):].split(',') filepath = self.concat_files_registry.concat_cached_filepath(paths) - return self.static_file(filepath) else: - relpath = relpath[len(self.base_datapath):] # skip leading '/data/' - dirpath, rid = config.locate_resource(relpath) - if dirpath is None: - raise NotFound() - return self.static_file(osp.join(dirpath, rid)) + # skip leading '/data/' and url params + relpath = relpath[len(self.base_datapath):].split('?', 1)[0] + dirpath, rid = config.locate_resource(relpath) + if dirpath is None: + raise NotFound() + filepath = osp.join(dirpath, rid) + return self.static_file(filepath) class FCKEditorController(StaticFileController):