diff options
author | ianb <devnull@localhost> | 2006-02-28 20:38:53 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-02-28 20:38:53 +0000 |
commit | aea54b214ab45ccfa37098e3b0af12f4585d9f63 (patch) | |
tree | 67f24ffce216907fd9a59fd3d60b2ab627710c95 /paste/httpexceptions.py | |
parent | b48e1693e68bda883342b13871a0870aa4bf9509 (diff) | |
download | paste-aea54b214ab45ccfa37098e3b0af12f4585d9f63.tar.gz |
Added a location method to redirect exceptions
Diffstat (limited to 'paste/httpexceptions.py')
-rw-r--r-- | paste/httpexceptions.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/paste/httpexceptions.py b/paste/httpexceptions.py index 4f2f366..9952b68 100644 --- a/paste/httpexceptions.py +++ b/paste/httpexceptions.py @@ -326,6 +326,13 @@ class _HTTPMove(HTTPRedirection): relative_redirect = classmethod(relative_redirect) + def location(self): + for name, value in self.headers: + if name.lower() == 'location': + return value + else: + raise KeyError("No location set for %s" % self) + class HTTPMultipleChoices(_HTTPMove): code = 300 title = 'Multiple Choices' |