diff options
author | Marcel Hellkamp <marc@gsites.de> | 2012-10-17 22:50:51 +0200 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2012-10-17 22:53:45 +0200 |
commit | c3dd6f5f09537f39e2b6f68b295de8f7518f7122 (patch) | |
tree | f8067075f34ee396ac47357ae895aeaefc1990a9 | |
parent | 698d1830be1491684ab77c546297667e01fd61c8 (diff) | |
download | bottle-c3dd6f5f09537f39e2b6f68b295de8f7518f7122.tar.gz |
fix #389: Bottle still raises DeprecationWarning in bottle.redirect() and Router.match()
-rw-r--r-- | bottle.py | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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): |