summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hellkamp <marc@gsites.de>2012-10-17 22:50:51 +0200
committerMarcel Hellkamp <marc@gsites.de>2012-10-17 22:53:45 +0200
commitc3dd6f5f09537f39e2b6f68b295de8f7518f7122 (patch)
treef8067075f34ee396ac47357ae895aeaefc1990a9
parent698d1830be1491684ab77c546297667e01fd61c8 (diff)
downloadbottle-c3dd6f5f09537f39e2b6f68b295de8f7518f7122.tar.gz
fix #389: Bottle still raises DeprecationWarning in bottle.redirect() and Router.match()
-rw-r--r--bottle.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/bottle.py b/bottle.py
index ee870b6..519023b 100644
--- a/bottle.py
+++ b/bottle.py
@@ -407,8 +407,7 @@ class Router(object):
allowed = [verb for verb in targets if verb != 'ANY']
if 'GET' in allowed and 'HEAD' not in allowed:
allowed.append('HEAD')
- raise HTTPError(405, "Method not allowed.",
- header=[('Allow',",".join(allowed))])
+ raise HTTPError(405, "Method not allowed.", Allow=",".join(allowed))
class Route(object):
@@ -2045,7 +2044,7 @@ def redirect(url, code=None):
if code is None:
code = 303 if request.get('SERVER_PROTOCOL') == "HTTP/1.1" else 302
location = urljoin(request.url, url)
- raise HTTPResponse("", status=code, header=dict(Location=location))
+ raise HTTPResponse("", status=code, Location=location)
def _file_iter_range(fp, offset, bytes, maxread=1024*1024):