| 1 | package HTTP::Engine::Middleware::DoCoMoGUID; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use HTTP::Engine::Middleware; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use HTML::StickyQuery; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | after_handle { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | my ( $c, $self, $req, $res ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=18.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | ▶ | if ( $res->status == 200 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
$res->status == 200 and $res->content_type =~ /html/ and not builtin::blessed($res->body) && $res->body
$res->status == 200 and $res->content_type =~ /html/
builtin::blessed($res->body) && $res->body
MC/DC0%0/4
$res->status == 200 and $res->content_type =~ /html/ and not builtin::blessed($res->body) && $res->body
$res->status == 200
$res->content_type =~ /html/
builtin::blessed($res->body)
$res->body
Truth table20%1/5
A and B and not(C && D)
A= $res->status == 200B= $res->content_type =~ /html/C= builtin::blessed($res->body)D= $res->body
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | && $res->content_type =~ /html/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | && not Scalar::Util::blessed $res->body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | && $res->body ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 2 | my $body = $res->body; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | $res->body( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | my $guid = HTML::StickyQuery->new( 'abs' => 1, ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | $guid->sticky( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | scalarref => \$body, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | param => { guid => 'ON' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | ->() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 2 | $res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | __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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||