fixed issue 1604:After web2py Upgrade, int status codes are no longer respected, thanks cfhowes

This commit is contained in:
mdipierro
2013-07-25 05:14:54 -05:00
parent ccdbb9a588
commit 61f5522661
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.07.25.05.11.38
Version 2.6.0-development+timestamp.2013.07.25.05.14.06
+3
View File
@@ -27,6 +27,7 @@ defined_status = {
307: 'TEMPORARY REDIRECT',
400: 'BAD REQUEST',
401: 'UNAUTHORIZED',
402: 'PAYMENT REQUIRED',
403: 'FORBIDDEN',
404: 'NOT FOUND',
405: 'METHOD NOT ALLOWED',
@@ -79,6 +80,8 @@ class HTTP(Exception):
headers = self.headers
if status in defined_status:
status = '%d %s' % (status, defined_status[status])
elif isinstance(status, int):
status = '%d UNKNOWN ERROR' % status
else:
status = str(status)
if not regex_status.match(status):