Skip to content

Commit abd4f0e

Browse files
simbabqueoalders
authored andcommitted
Make 308 is_cacheable_by_default #150
1 parent 2e8842e commit abd4f0e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Revision history for HTTP-Message
22

33
{{$NEXT}}
44
- Clean up backcompat code (GH#148) (Dan Book)
5+
- Add "308 Permanent Redirect" to is_cacheable_by_default (GH#150) (simbabque)
56

67
6.26 2020-09-10 02:34:25Z
78
- Update comment which explains in which RFC 451 is defined (GH#143) (Olaf

lib/HTTP/Status.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ sub is_cacheable_by_default ($) { $_[0] && ( $_[0] == 200 # OK
153153
|| $_[0] == 206 # Not Acceptable
154154
|| $_[0] == 300 # Multiple Choices
155155
|| $_[0] == 301 # Moved Permanently
156+
|| $_[0] == 308 # Permanent Redirect
156157
|| $_[0] == 404 # Not Found
157158
|| $_[0] == 405 # Method Not Allowed
158159
|| $_[0] == 410 # Gone
@@ -275,7 +276,7 @@ The status_message() function will translate status codes to human
275276
readable strings. The string is the same as found in the constant
276277
names above. If the $code is not registered in the L<list of IANA HTTP Status
277278
Codes|https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml>
278-
then C<undef> is returned.
279+
then C<undef> is returned.
279280
280281
=item is_info( $code )
281282

t/status.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use strict;
22
use warnings;
33

44
use Test::More;
5-
plan tests => 48;
5+
plan tests => 49;
66

77
use HTTP::Status qw(:constants :is status_message);
88

@@ -47,7 +47,7 @@ ok(!is_redirect(99));
4747

4848
ok(is_cacheable_by_default($_),
4949
"Cacheable by default [$_] " . status_message($_)
50-
) for (200,203,204,206,300,301,404,405,410,414,451,501);
50+
) for (200,203,204,206,300,301,308,404,405,410,414,451,501);
5151

5252
ok(!is_cacheable_by_default($_),
5353
"... is not cacheable [$_] " . status_message($_)

0 commit comments

Comments
 (0)