diff options
-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' |