Permalink
Comparing changes
Open a pull request
- 2 commits
- 2 files changed
- 0 commit comments
- 2 contributors
Unified
Split
Showing
with
5 additions
and 5 deletions.
- +3 −3 pylons/controllers/util.py
- +2 −2 tests/test_units/test_controller.py
| @@ -174,7 +174,7 @@ def index(self): | ||
| response.headers.pop('Content-Type', None) | ||
| response.headers.pop('Cache-Control', None) | ||
| response.headers.pop('Pragma', None) | ||
| raise status_map[304]().exception | ||
| raise status_map[304]() | ||
| else: | ||
| log.debug("ETag didn't match, returning response object") | ||
| @@ -207,7 +207,7 @@ def abort(status_code=None, detail="", headers=None, comment=None): | ||
| comment=comment) | ||
| log.debug("Aborting request, status: %s, detail: %r, headers: %r, " | ||
| "comment: %r", status_code, detail, headers, comment) | ||
| raise exc.exception | ||
| raise exc | ||
| def redirect(url, code=302): | ||
| @@ -221,4 +221,4 @@ def redirect(url, code=302): | ||
| """ | ||
| log.debug("Generating %s redirect" % code) | ||
| exc = status_map[code] | ||
| raise exc(location=url).exception | ||
| raise exc(location=url) | ||
| @@ -36,11 +36,11 @@ def strme(self): | ||
| def use_redirect(self): | ||
| pylons.response.set_cookie('message', 'Hello World') | ||
| exc = status_map[301] | ||
| raise exc('/elsewhere').exception | ||
| raise exc('/elsewhere') | ||
| def use_customnotfound(self): | ||
| exc = status_map[404] | ||
| raise exc('Custom not found').exception | ||
| raise exc('Custom not found') | ||
| def header_check(self): | ||
| pylons.response.headers['Content-Type'] = 'text/plain' | ||