Skip to content

Commit

Permalink
Merge pull request #559 from chripede/chripede-patch-1
Browse files Browse the repository at this point in the history
Add additional HTTP status codes
  • Loading branch information
kgriffs committed Jul 1, 2015
2 parents b2eac62 + 702b7a7 commit a9946d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/api/status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ string objects that must be created when preparing responses.
HTTP_EXPECTATION_FAILED = HTTP_417
HTTP_IM_A_TEAPOT = HTTP_418
HTTP_UPGRADE_REQUIRED = HTTP_426
HTTP_PRECONDITION_REQUIRED = HTTP_428
HTTP_TOO_MANY_REQUESTS = HTTP_429
HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = HTTP_431
HTTP_400 = '400 Bad Request'
HTTP_401 = '401 Unauthorized' # <-- Really means "unauthenticated"
Expand All @@ -117,6 +120,9 @@ string objects that must be created when preparing responses.
HTTP_417 = '417 Expectation Failed'
HTTP_418 = "418 I'm a teapot"
HTTP_426 = '426 Upgrade Required'
HTTP_428 = '428 Precondition Required'
HTTP_429 = '429 Too Many Requests'
HTTP_431 = '431 Request Header Fields Too Large'
5xx Server Error
----------------
Expand All @@ -129,10 +135,12 @@ string objects that must be created when preparing responses.
HTTP_SERVICE_UNAVAILABLE = HTTP_503
HTTP_GATEWAY_TIMEOUT = HTTP_504
HTTP_HTTP_VERSION_NOT_SUPPORTED = HTTP_505
HTTP_NETWORK_AUTHENTICATION_REQUIRED = HTTP_511
HTTP_500 = '500 Internal Server Error'
HTTP_501 = '501 Not Implemented'
HTTP_502 = '502 Bad Gateway'
HTTP_503 = '503 Service Unavailable'
HTTP_504 = '504 Gateway Time-out'
HTTP_505 = '505 HTTP Version not supported'
HTTP_511 = '511 Network Authentication Required'
8 changes: 8 additions & 0 deletions falcon/status_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
HTTP_IM_A_TEAPOT = HTTP_418
HTTP_426 = '426 Upgrade Required'
HTTP_UPGRADE_REQUIRED = HTTP_426
HTTP_428 = '428 Precondition Required'
HTTP_PRECONDITION_REQUIRED = HTTP_428
HTTP_429 = '429 Too Many Requests'
HTTP_TOO_MANY_REQUESTS = HTTP_429
HTTP_431 = '431 Request Header Fields Too Large'
HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = HTTP_431

HTTP_500 = '500 Internal Server Error'
HTTP_INTERNAL_SERVER_ERROR = HTTP_500
Expand All @@ -103,6 +109,8 @@
HTTP_GATEWAY_TIMEOUT = HTTP_504
HTTP_505 = '505 HTTP Version not supported'
HTTP_HTTP_VERSION_NOT_SUPPORTED = HTTP_505
HTTP_511 = '511 Network Authentication Required'
HTTP_NETWORK_AUTHENTICATION_REQUIRED = HTTP_511

# 70X - Inexcusable
HTTP_701 = '701 Meh'
Expand Down

0 comments on commit a9946d7

Please sign in to comment.