From 5fc938cbd166fdf02685baa316ecca5703450d5d Mon Sep 17 00:00:00 2001 From: Robert Romano Date: Wed, 23 Dec 2015 12:54:17 -0800 Subject: [PATCH 1/2] The Internet Engineering Task Force approved the new HTTP status code 451. Adding to status.py and docs appropriately. --- docs/api-guide/status-codes.md | 1 + rest_framework/status.py | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/api-guide/status-codes.md b/docs/api-guide/status-codes.md index d81e092c5..e2652bcfd 100644 --- a/docs/api-guide/status-codes.md +++ b/docs/api-guide/status-codes.md @@ -89,6 +89,7 @@ The 4xx class of status code is intended for cases in which the client seems to HTTP_428_PRECONDITION_REQUIRED HTTP_429_TOO_MANY_REQUESTS HTTP_431_REQUEST_HEADER_FIELDS_TOO_LARGE + HTTP_451_UNAVAILABLE_FOR_LEGAL_REASONS ## Server Error - 5xx diff --git a/rest_framework/status.py b/rest_framework/status.py index 90a755089..ed1b4784b 100644 --- a/rest_framework/status.py +++ b/rest_framework/status.py @@ -65,6 +65,7 @@ HTTP_417_EXPECTATION_FAILED = 417 HTTP_428_PRECONDITION_REQUIRED = 428 HTTP_429_TOO_MANY_REQUESTS = 429 HTTP_431_REQUEST_HEADER_FIELDS_TOO_LARGE = 431 +HTTP_451_UNAVAILABLE_FOR_LEGAL_REASONS = 451 HTTP_500_INTERNAL_SERVER_ERROR = 500 HTTP_501_NOT_IMPLEMENTED = 501 HTTP_502_BAD_GATEWAY = 502 From c8915c07160f3286d8d7d9c1258739cee067e054 Mon Sep 17 00:00:00 2001 From: Robert Romano Date: Wed, 23 Dec 2015 12:58:14 -0800 Subject: [PATCH 2/2] Change tab to spaces --- docs/api-guide/status-codes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/status-codes.md b/docs/api-guide/status-codes.md index e2652bcfd..398c04804 100644 --- a/docs/api-guide/status-codes.md +++ b/docs/api-guide/status-codes.md @@ -89,7 +89,7 @@ The 4xx class of status code is intended for cases in which the client seems to HTTP_428_PRECONDITION_REQUIRED HTTP_429_TOO_MANY_REQUESTS HTTP_431_REQUEST_HEADER_FIELDS_TOO_LARGE - HTTP_451_UNAVAILABLE_FOR_LEGAL_REASONS + HTTP_451_UNAVAILABLE_FOR_LEGAL_REASONS ## Server Error - 5xx