Apache-AxKit-Plugin-AddXSLParams-Request

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Param Prefix: request.headers.*
 
Implemented Fields:
 
The headers sent during a request vary somewhat from client to client;
this group will contain *all* the headers returned by the request
object's headers_in() method using the convention:
request.headers.*fieldname* where *fieldname* is name of the given HTTP
header field, forced to lower case.
 
If any HTTP Cookies are found in the headers, they will be parsed and
values available as XSLT params using the naming convention:
request.cookies.*yourcookiename*. See the Cookies group below for an
alternative way to access cookies.
 
More common headers include:
 
* accept
* content-type
* accept-charset
* accept-encoding
* accept-language
* connection

README  view on Meta::CPAN

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
    * from
    * referer
 
    Examples:
 
      <xsl:param name="request.headers.accept-language"/>
      <xsl:param name="request.headers.host"/>
      <xsl:param name="request.headers.user-agent"/>
      <xsl:param name="request.headers.referer"/>
 
Cookies
    Provides an *alternative* way to access the HTTP Cookies header for
    those folks that want to get at the cookie data but don't want to pull
    in all of the other HTTP headers.
 
    Param Prefix: request.cookies.*
 
    Implemented Fields:
 
    Cookie values are made available as params using the convention:
    request.cookies.*yourcookiename*
 
    Examples:
 
      <xsl:param name="request.cookies.oreo"/>
      <xsl:param name="request.cookies.chocolate-chip"/>
      <xsl:param name="request.cookies.fortune"/>
 
VerboseURI
    Offers fine-grained access to the URI requested (via Apache::URI's

README  view on Meta::CPAN

146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
    Examples:
 
      <xsl:param name="request.uri.path"/>
      <xsl:param name="request.uri.scheme"/>
      <xsl:param name="request.uri.port"/>
 
DEPENDENCIES
    * libapreq
    * Apache::Request
    * Apache::Cookie
    * Apache::URI
    * AxKit (1.5 or greater)
 
AUTHOR
    Kip Hampton, khampton@totalcinema.com
 
SEE ALSO
    AxKit, Apache::Request, libapreq, Apache::Cookie, Apache::URI

Request.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 
use strict;
use vars qw($VERSION);
$VERSION = '1.02';
 
 
sub handler {
    my $r = shift;
    my $uri = $r->uri;
    my $cgi = Apache::Request->instance($r);
    my @allowed_groups = split /\s+/, $r->dir_config('AxAddXSLParamGroups') || ();
      
    # HTTP Headers
    if ( grep { $_ eq 'HTTPHeaders' } @allowed_groups ) {
        my $headers = $r->headers_in();
        foreach my $h ( keys( %{$headers} ) ) {
            #warn "Processing header " .  lc( $h ) . " = " . $headers->{$h} . " \n";
            if ( $h eq 'Cookie' ) {
                my $cookies = Apache::Cookie::parse( $headers->{$h} );
                foreach my $oreo ( keys( %{$cookies} ) ) {
                    $cgi->parms->set('request.cookie.' . $oreo => $cookies->{$oreo}->value ) if defined( $cookies->{$oreo}->value );
 
                }
            }
         
            $cgi->parms->set('request.headers.' . lc( $h ) => $headers->{$h});
        }
    }
             
    # Allow 'em to get Cookies header without all the other headers as an alternative
    elsif ( grep { $_ eq 'Cookies' } @allowed_groups ) {
        my $cookies = Apache::Cookie::parse( $r->header_in('Cookie') );
        foreach my $oreo ( keys( %{$cookies} ) ) {
            $cgi->parms->set('request.cookie.' . $oreo => $cookies->{$oreo}->value ) if defined( $cookies->{$oreo}->value );
 
        }
    
        
    # Here's the "Request-Common" group
    if ( grep { $_ eq 'Request-Common' } @allowed_groups ) {
        $cgi->parms->set('request.uri' => $r->uri );
        $cgi->parms->set('request.filename' => $r->filename);

Request.pm  view on Meta::CPAN

150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
B<Param Prefix>: request.headers.*
 
B<Implemented Fields>:
 
The headers sent during a request vary somewhat from client to client; this
group will contain I<all> the headers returned by the request object's
headers_in() method using the convention: request.headers.I<fieldname> where
I<fieldname> is name of the given HTTP header field, forced to lower case.
 
If any HTTP Cookies are found in the headers, they will be parsed and values available as XSLT
params using the naming convention: request.cookies.I<yourcookiename>. See the B<Cookies> group
below for an alternative way to access cookies.
 
More common headers include:
 
=over 4
 
=item * accept
 
=item * content-type

Request.pm  view on Meta::CPAN

189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
=back
 
B<Examples>:
 
  <xsl:param name="request.headers.accept-language"/>
  <xsl:param name="request.headers.host"/>
  <xsl:param name="request.headers.user-agent"/>
  <xsl:param name="request.headers.referer"/>
 
=head1 B<Cookies>
 
Provides an I<alternative> way to access the HTTP Cookies header for those folks
that want to get at the cookie data but don't want to pull in all of the other
HTTP headers.
 
B<Param Prefix>: request.cookies.*
 
B<Implemented Fields>:
 
Cookie values are made available as params using the convention: request.cookies.I<yourcookiename>
 
B<Examples>:
 
  <xsl:param name="request.cookies.oreo"/>
  <xsl:param name="request.cookies.chocolate-chip"/>
  <xsl:param name="request.cookies.fortune"/>
 
=head1 B<VerboseURI>
 
Offers fine-grained access to the URI requested (via Apache::URI's parse_uri() method.

Request.pm  view on Meta::CPAN

253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
  <xsl:param name="request.uri.port"/>
 
=head1 DEPENDENCIES
 
=over 4
 
=item * libapreq
 
=item * Apache::Request
 
=item * Apache::Cookie
 
=item * Apache::URI
 
=item * AxKit (1.5 or greater)
 
=back
 
=head1 AUTHOR
 
Kip Hampton, khampton@totalcinema.com
 
=head1 SEE ALSO
 
AxKit, Apache::Request, libapreq, Apache::Cookie, Apache::URI
 
=cut



( run in 0.253 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )