| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Maypole::Headers; |
|
2
|
2
|
|
|
2
|
|
2881
|
use base 'HTTP::Headers'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
10821
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
41355
|
use strict; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
76
|
|
|
5
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
640
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "1." . sprintf "%04d", q$Rev: 376 $ =~ /: (\d+)/; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub get { |
|
10
|
10
|
|
|
10
|
1
|
2796
|
shift->header(shift); |
|
11
|
|
|
|
|
|
|
} |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub set { |
|
14
|
3
|
|
|
3
|
1
|
3700
|
shift->header(@_); |
|
15
|
|
|
|
|
|
|
} |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
*add = \&push; # useful for Apache::Session::Wrapper support |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub push { |
|
20
|
2
|
|
|
2
|
1
|
1475
|
shift->push_header(@_); |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub init { |
|
24
|
2
|
|
|
2
|
1
|
1742
|
shift->init_header(@_); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub remove { |
|
28
|
1
|
|
|
1
|
1
|
1306
|
shift->remove_header(@_); |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub field_names { |
|
32
|
1
|
|
|
1
|
1
|
1110
|
shift->header_field_names(@_); |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=pod |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Maypole::Headers - Convenience wrapper around HTTP::Headers |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
use Maypole::Headers; |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
$r->headers_out(Maypole::Headers->new); # Note, automatic in Maypole |
|
48
|
|
|
|
|
|
|
$r->headers_out->set('Content-Base' => 'http://localhost/maypole'); |
|
49
|
|
|
|
|
|
|
$r->headers_out->push('Set-Cookie' => $cookie->as_string); |
|
50
|
|
|
|
|
|
|
$r->headers_out->push('Set-Cookie' => $cookie2->as_string); |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
print $r->headers_out->as_string; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
A convenience wrapper around C. Additional methods are provided |
|
57
|
|
|
|
|
|
|
to make the mutators less repetitive and wordy. For example: |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$r->headers_out->header(Content_Base => $r->config->uri_base); |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
can be written as: |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
$r->headers_out->set(Content_Base => $r->config->uri_base); |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 METHODS |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
All the standard L methods, plus the following: |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=over |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item get($header) |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Get the value of a header field. |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
An alias to Cheader> |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item set($header =C $value, ...) |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Set the value of one or more header fields |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
An alias to Cheader> |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item push($header =C $value) |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Add a value to the field named C<$header>. Previous values are maintained. |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
An alias to Cpush_header> |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item add |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Alias to C - useful for C support, in CGI mode. |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item init($header =C $value) |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Set the value for the field named C<$header>, but only if that header is |
|
96
|
|
|
|
|
|
|
currently undefined. |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
An alias to Cinit_header> |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item remove($header, ...) |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Remove one of more headers |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
An alias to Cremove_header> |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item field_names() |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Returns a list of distinct header names |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
An alias to Cheader_field_names> |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=back |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
L |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 AUTHOR |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Simon Flack |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |