From 257459ef402424d5ba001b84ae33de87d39b56b8 Mon Sep 17 00:00:00 2001 From: Luca Guidi Date: Thu, 27 Nov 2014 23:59:40 +0100 Subject: [PATCH] Update HTTP status codes to IETF RFC 7231 via @tonyta See: https://github.com/rack/rack/commit/be28c6a2ac152fe4adfbef71f3db9f4200df89e8 --- lib/lotus/http/status.rb | 4 ++++ test/fixtures.rb | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/lotus/http/status.rb b/lib/lotus/http/status.rb index b84eaf1a..a9b0c365 100644 --- a/lib/lotus/http/status.rb +++ b/lib/lotus/http/status.rb @@ -14,6 +14,9 @@ class Status ALL = ::Rack::Utils::HTTP_STATUS_CODES.dup.merge({ 103 => 'Checkpoint', 122 => 'Request-URI too long', + 413 => 'Payload Too Large', # Rack 1.5 compat + 414 => 'URI Too Long', # Rack 1.5 compat + 416 => 'Range Not Satisfiable', # Rack 1.5 compat 418 => 'I\'m a teapot', 420 => 'Enhance Your Calm', 444 => 'No Response', @@ -21,6 +24,7 @@ class Status 450 => 'Blocked by Windows Parental Controls', 451 => 'Wrong Exchange server', 499 => 'Client Closed Request', + 506 => 'Variant Also Negotiates', # Rack 1.5 compat 598 => 'Network read timeout error', 599 => 'Network connect timeout error' }).freeze diff --git a/test/fixtures.rb b/test/fixtures.rb index cb9748a9..6c7b2732 100644 --- a/test/fixtures.rb +++ b/test/fixtures.rb @@ -20,7 +20,6 @@ 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', - 306 => 'Reserved', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect', 400 => 'Bad Request', @@ -36,10 +35,10 @@ 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Long', + 413 => 'Payload Too Large', + 414 => 'URI Too Long', 415 => 'Unsupported Media Type', - 416 => 'Requested Range Not Satisfiable', + 416 => 'Range Not Satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', 420 => 'Enhance Your Calm', @@ -61,10 +60,9 @@ 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported', - 506 => 'Variant Also Negotiates (Experimental)', + 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected', - 509 => 'Unassigned', 510 => 'Not Extended', 511 => 'Network Authentication Required', 598 => 'Network read timeout error',