summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-09-25 09:32:35 +0000
committerLars Wirzenius <liw@liw.fi>2017-09-25 09:32:35 +0000
commit42f63e5791562021fe0da38445523fd503630444 (patch)
tree4a0224635817399da6775e68ff64fd91865e9648
parent17431040c1ad62dd7347cb35510af5b21f43af9e (diff)
downloadapifw-42f63e5791562021fe0da38445523fd503630444.tar.gz
Add: give callbacks raw_uri_path keyword argument
-rw-r--r--NEWS3
-rw-r--r--apifw/bottleapp.py1
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 3f2a9b9..8354f08 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ This file summarizes changes between releases of `apifw`.
Version 0.9+git, not yet released
---------------------------------
+* Callbacks now get an extra keyword argument `raw_uri_path` so they
+ can, if they need to, process it before URL decoding happens. Qvarn
+ needs this for searches.
Version 0.9, released 2017-08-19
---------------------------------
diff --git a/apifw/bottleapp.py b/apifw/bottleapp.py
index 76602c6..0d61e09 100644
--- a/apifw/bottleapp.py
+++ b/apifw/bottleapp.py
@@ -237,6 +237,7 @@ class BottleApplication:
def _callback_with_body(self, callback):
def wrapper(*args, **kwargs):
+ kwargs['raw_uri_path'] = bottle.request.environ['RAW_URI']
content_type, body = self._get_request_body()
response = callback(content_type, body, *args, **kwargs)
return bottle.HTTPResponse(