Skip to content

Commit

Permalink
added support for 451 status code
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 12, 2012
1 parent 2453eab commit a70c9eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@

3.0 2012-06-12
- Code name "Rainbow", this is a major release.
- Added support for new HTTP status code.
- Renamed Mojo::CookieJar to Mojo::UserAgent::CookieJar.
- Improved message parser performance slightly.
- Improved documentation. (ichesnokov, sri)
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/Message/Response.pm
Expand Up @@ -29,7 +29,7 @@ my %MESSAGES = (
304 => 'Not Modified',
305 => 'Use Proxy',
307 => 'Temporary Redirect',
308 => 'Permanent Redirect', # draft-reschke-http-status-308
308 => 'Permanent Redirect', # Draft
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
Expand Down Expand Up @@ -58,6 +58,7 @@ my %MESSAGES = (
429 => 'Too Many Requests', # RFC 6585
431 => 'Request Header Fields Too Large', # RFC 6585
449 => 'Retry With', # Unofficial (Microsoft)
451 => 'Unavailable For Legal Reasons', # Draft
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
Expand Down
6 changes: 4 additions & 2 deletions t/mojo/response.t
@@ -1,6 +1,6 @@
use Mojo::Base -strict;

use Test::More tests => 354;
use Test::More tests => 355;

# "Quick Smithers. Bring the mind eraser device!
# You mean the revolver, sir?
Expand Down Expand Up @@ -66,7 +66,9 @@ is $res->code(428)->default_message, 'Precondition Required', 'right message';
is $res->code(429)->default_message, 'Too Many Requests', 'right message';
is $res->code(431)->default_message, 'Request Header Fields Too Large',
'right message';
is $res->code(449)->default_message, 'Retry With', 'right message';
is $res->code(449)->default_message, 'Retry With', 'right message';
is $res->code(451)->default_message, 'Unavailable For Legal Reasons',
'right message';
is $res->code(500)->default_message, 'Internal Server Error', 'right message';
is $res->code(501)->default_message, 'Not Implemented', 'right message';
is $res->code(502)->default_message, 'Bad Gateway', 'right message';
Expand Down

0 comments on commit a70c9eb

Please sign in to comment.