From 63b0ba40501ab05745b0a56bdbfd601985053eed Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 13 Nov 2017 13:39:48 +0100 Subject: Fix: do not require RAW_URI in request, to ease testing --- NEWS | 2 ++ apifw/bottleapp.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5837704..961a87f 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ This file summarizes changes between releases of `apifw`. Version 0.15+git, not yet released ---------------------------------- +* Do not require `RAW_URI` in the request environment, to allow + testing without gunicorn. Version 0.15, released 2017-10-09 ---------------------------------- diff --git a/apifw/bottleapp.py b/apifw/bottleapp.py index 541ddfe..99cced0 100644 --- a/apifw/bottleapp.py +++ b/apifw/bottleapp.py @@ -249,7 +249,7 @@ class BottleApplication: def _callback_with_body(self, callback): def wrapper(*args, **kwargs): - kwargs['raw_uri_path'] = bottle.request.environ['RAW_URI'] + kwargs['raw_uri_path'] = bottle.request.environ.get('RAW_URI', '') content_type, body = self._get_request_body() response = callback(content_type, body, *args, **kwargs) return bottle.HTTPResponse( -- cgit v1.2.1