Throwable/Role/Status/NotModified.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 93.3% 28 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
default_status_code
1.0
CRAP 1.0
« Throwable/Role/BoringText.pm ↑ Summary Throwable/Role/Status/MethodNotAllowed.pm »
1 package HTTP::Throwable::Role::Status::NotModified 0.028;
2 1 our $AUTHORITY = 'cpan:STEVAN';
3  
4 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Plack::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 with(
9 'HTTP::Throwable',
10 'HTTP::Throwable::Role::BoringText',
11 );
12  
13 2 ▶sub default_status_code { 304 }
Subroutine default_status_code: called CC=1 SCAR=0.0
Pod undocumented
14 2 ▶sub default_reason { 'Not Modified' }
Subroutine default_reason: called CC=1 SCAR=0.0
Pod undocumented
15  
16 2 ▶around 'as_psgi' => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
17 2 my $next = shift;
18 2 my $self = shift;
19 2 my $psgi = $self->$next();
20  
21 # MUST NOT have a message body, see below
22 2 Plack::Util::header_set( $psgi->[1], 'Content-Length' => 0 );
23 2 Plack::Util::header_remove( $psgi->[1], 'Content-Type');
24  
25 2 $psgi->[2] = [];
26  
27 2 $psgi;
28 1 };
29  
30 1 ▶no Moo::Role; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 =pod
33  
34 =encoding UTF-8
35  
36 =head1 NAME
37  
38 HTTP::Throwable::Role::Status::NotModified - 304 Not Modified
39  
40 =head1 VERSION
41  
42 version 0.028
43  
44 =head1 DESCRIPTION
45  
46 If the client has performed a conditional GET request and access
47 is allowed, but the document has not been modified, the server
48 SHOULD respond with this status code. The 304 response MUST NOT
49 contain a message-body, and thus is always terminated by the
50 first empty line after the header fields.
51  
52 The response MUST include the following header fields:
53  
54 =over 4
55  
56 =item Date, unless its omission is required by section 14.18.1
57  
58 If a clockless origin server obeys these rules, and proxies and
59 clients add their own Date to any response received without one
60 (as already specified by [RFC 2068], section 14.19), caches will
61 operate correctly.
62  
63 =item ETag and/or Content-Location, if the header would have been sent in a 200 response to the same request
64  
65 =item Expires, Cache-Control, and/or Vary, if the field-value might differ from that sent in any previous response for the same variant
66  
67 =back
68  
69 If the conditional GET used a strong cache validator, the response
70 SHOULD NOT include other entity-headers. Otherwise (i.e., the conditional
71 GET used a weak validator), the response MUST NOT include other
72 entity-headers; this prevents inconsistencies between cached
73 entity-bodies and updated headers.
74  
75 If a 304 response indicates an entity not currently cached, then
76 the cache MUST disregard the response and repeat the request without
77 the conditional.
78  
79 If a cache uses a received 304 response to update a cache entry,
80 the cache MUST update the entry to reflect any new field values
81 given in the response.
82  
83 =head1 PERL VERSION
84  
85 This library should run on perls released even a long time ago. It should work
86 on any version of perl released in the last five years.
87  
88 Although it may work on older versions of perl, no guarantee is made that the
89 minimum required version will not be increased. The version may be increased
90 for any reason, and there is no promise that patches will be accepted to lower
91 the minimum required perl.
92  
93 =head1 AUTHORS
94  
95 =over 4
96  
97 =item *
98  
99 Stevan Little <stevan.little@iinteractive.com>
100  
101 =item *
102  
103 Ricardo Signes <cpan@semiotic.systems>
104  
105 =back
106  
107 =head1 COPYRIGHT AND LICENSE
108  
109 This software is copyright (c) 2011 by Infinity Interactive, Inc.
110  
111 This is free software; you can redistribute it and/or modify it under
112 the same terms as the Perl 5 programming language system itself.
113  
114 =cut
115  
116 __END__
« Throwable/Role/BoringText.pm ↑ Summary Throwable/Role/Status/MethodNotAllowed.pm »