From 5c9282aca50657058cb9ee4f62c6d7e9432fe66b Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 8 Aug 2014 00:50:42 -0500 Subject: [PATCH] fixed issue 1947, raw args in expose, thanks iiijjjiii --- VERSION | 2 +- gluon/tools.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 9a3b3b22..078d7dd8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.9.5-trunk+timestamp.2014.08.08.00.36.55 +Version 2.9.5-trunk+timestamp.2014.08.08.00.49.39 diff --git a/gluon/tools.py b/gluon/tools.py index 099e9792..0fef93e3 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -5379,8 +5379,11 @@ class Expose(object): base = base or os.path.join(current.request.folder, 'static') basename = basename or current.request.function self.basename = basename - self.args = current.request.raw_args and \ - [arg for arg in current.request.raw_args.split('/') if arg] or [] + + if current.request.raw_args: + self.args = [arg for arg in current.request.raw_args.split('/') if arg] + else: + self.args = [arg for arg in current.request.args if args] filename = os.path.join(base, *self.args) if not os.path.exists(filename): raise HTTP(404, "FILE NOT FOUND")