| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTTP::Engine::Middleware::DoCoMoGUID; |
|
2
|
1
|
|
|
1
|
|
405
|
use HTTP::Engine::Middleware; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
5
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use Scalar::Util (); |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
13
|
|
|
4
|
1
|
|
|
1
|
|
3
|
use HTML::StickyQuery; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
147
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
after_handle { |
|
7
|
|
|
|
|
|
|
my ( $c, $self, $req, $res ) = @_; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
if ( $res->status == 200 |
|
10
|
|
|
|
|
|
|
&& $res->content_type =~ /html/ |
|
11
|
|
|
|
|
|
|
&& not Scalar::Util::blessed $res->body |
|
12
|
|
|
|
|
|
|
&& $res->body ) |
|
13
|
|
|
|
|
|
|
{ |
|
14
|
|
|
|
|
|
|
my $body = $res->body; |
|
15
|
|
|
|
|
|
|
$res->body( |
|
16
|
|
|
|
|
|
|
sub { |
|
17
|
|
|
|
|
|
|
my $guid = HTML::StickyQuery->new( 'abs' => 1, ); |
|
18
|
|
|
|
|
|
|
$guid->sticky( |
|
19
|
|
|
|
|
|
|
scalarref => \$body, |
|
20
|
|
|
|
|
|
|
param => { guid => 'ON' }, |
|
21
|
|
|
|
|
|
|
); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
->() |
|
24
|
|
|
|
|
|
|
); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$res; |
|
28
|
|
|
|
|
|
|
}; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__MIDDLEWARE__ |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
HTTP::Engine::Middleware::DoCoMoGUID - append guid=ON on each anchor tag |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
This module appends ?guid=ON on each anchor tag. |
|
41
|
|
|
|
|
|
|
This feature is needed by Japanese mobile web site developers. |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 AUTHORS |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
tokuhirom |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
yappo |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
L<HTML::StickyQuery> |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |