| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Test::Apache::RewriteRules::ClientEnvs; |
|
2
|
2
|
|
|
2
|
|
841
|
use strict; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
116
|
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
63
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
1824
|
use Exporter::Lite; |
|
|
2
|
|
|
|
|
1551
|
|
|
|
2
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
|
|
our @EXPORT = qw( |
|
7
|
|
|
|
|
|
|
with_request_method |
|
8
|
|
|
|
|
|
|
with_http_cookie |
|
9
|
|
|
|
|
|
|
with_http_header_field |
|
10
|
|
|
|
|
|
|
); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $UserAgent; |
|
13
|
|
|
|
|
|
|
our $RequestMethod; |
|
14
|
|
|
|
|
|
|
our $Cookies ||= []; |
|
15
|
|
|
|
|
|
|
our $HttpHeader ||= []; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $user_agent_name; |
|
18
|
|
|
|
|
|
|
for my $b ( |
|
19
|
|
|
|
|
|
|
[ |
|
20
|
|
|
|
|
|
|
docomo => 'DoCoMo/1.0/N506iS/c20/TB/W20H11', |
|
21
|
|
|
|
|
|
|
], |
|
22
|
|
|
|
|
|
|
[ |
|
23
|
|
|
|
|
|
|
ezweb => 'KDDI-SA31 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0', |
|
24
|
|
|
|
|
|
|
], |
|
25
|
|
|
|
|
|
|
[ |
|
26
|
|
|
|
|
|
|
softbank => 'SoftBank/1.0/910T/TJ001%%SBSerialNumber%% Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1', |
|
27
|
|
|
|
|
|
|
], |
|
28
|
|
|
|
|
|
|
[ |
|
29
|
|
|
|
|
|
|
iphone => |
|
30
|
|
|
|
|
|
|
'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16', |
|
31
|
|
|
|
|
|
|
], |
|
32
|
|
|
|
|
|
|
[ |
|
33
|
|
|
|
|
|
|
ipod => |
|
34
|
|
|
|
|
|
|
'Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_3 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16', |
|
35
|
|
|
|
|
|
|
], |
|
36
|
|
|
|
|
|
|
[ |
|
37
|
|
|
|
|
|
|
ipad => |
|
38
|
|
|
|
|
|
|
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; ja-jp) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10', |
|
39
|
|
|
|
|
|
|
], |
|
40
|
|
|
|
|
|
|
[ |
|
41
|
|
|
|
|
|
|
android => |
|
42
|
|
|
|
|
|
|
'Mozilla/5.0 (Linux; U; Android 1.6; ja-jp; SonyEricssonSO-01B Build/R1EA018) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1', |
|
43
|
|
|
|
|
|
|
], |
|
44
|
|
|
|
|
|
|
[ |
|
45
|
|
|
|
|
|
|
dsi => |
|
46
|
|
|
|
|
|
|
'Opera/9.50 (Nintendo DSi; Opera/507; U; ja)', |
|
47
|
|
|
|
|
|
|
], |
|
48
|
|
|
|
|
|
|
[ |
|
49
|
|
|
|
|
|
|
wii => |
|
50
|
|
|
|
|
|
|
'Opera/9.30 (Nintendo Wii; U; ; 3642; ja)', |
|
51
|
|
|
|
|
|
|
], |
|
52
|
|
|
|
|
|
|
[ |
|
53
|
|
|
|
|
|
|
firefox => |
|
54
|
|
|
|
|
|
|
'Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9', |
|
55
|
|
|
|
|
|
|
], |
|
56
|
|
|
|
|
|
|
[ |
|
57
|
|
|
|
|
|
|
safari => |
|
58
|
|
|
|
|
|
|
'Mozilla/5.0 (Windows; U; Windows NT 5.1; ja-JP) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10', |
|
59
|
|
|
|
|
|
|
], |
|
60
|
|
|
|
|
|
|
[ |
|
61
|
|
|
|
|
|
|
chrome => |
|
62
|
|
|
|
|
|
|
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.29 Safari/533.4', |
|
63
|
|
|
|
|
|
|
], |
|
64
|
|
|
|
|
|
|
[ |
|
65
|
|
|
|
|
|
|
opera => |
|
66
|
|
|
|
|
|
|
'Opera/9.80 (Windows NT 6.0; U; ja) Presto/2.5.22 Version/10.51', |
|
67
|
|
|
|
|
|
|
], |
|
68
|
|
|
|
|
|
|
[ |
|
69
|
|
|
|
|
|
|
ie => |
|
70
|
|
|
|
|
|
|
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; IEMB3; IEMB3)', |
|
71
|
|
|
|
|
|
|
], |
|
72
|
|
|
|
|
|
|
[ |
|
73
|
|
|
|
|
|
|
googlebot => |
|
74
|
|
|
|
|
|
|
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)', |
|
75
|
|
|
|
|
|
|
], |
|
76
|
|
|
|
|
|
|
[ |
|
77
|
|
|
|
|
|
|
googlebot_mobile => |
|
78
|
|
|
|
|
|
|
'DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)', |
|
79
|
|
|
|
|
|
|
], |
|
80
|
|
|
|
|
|
|
) { |
|
81
|
0
|
|
|
0
|
0
|
|
eval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
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub with_%s_browser (&) { |
|
83
|
|
|
|
|
|
|
my ($code) = @_; |
|
84
|
|
|
|
|
|
|
local $UserAgent = q[%s]; |
|
85
|
|
|
|
|
|
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
|
86
|
|
|
|
|
|
|
$code->(); |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
1; |
|
89
|
|
|
|
|
|
|
}, $b->[0], $b->[1] or die $@; |
|
90
|
|
|
|
|
|
|
push @EXPORT, sprintf 'with_%s_browser', $b->[0]; |
|
91
|
|
|
|
|
|
|
$user_agent_name->{$b->[0]} = $b->[1]; |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub with_request_method (&$) { |
|
95
|
0
|
|
|
0
|
1
|
|
my ($code, $method) = @_; |
|
96
|
0
|
|
|
|
|
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
|
97
|
0
|
|
|
|
|
|
local $RequestMethod = $method; |
|
98
|
0
|
|
|
|
|
|
$code->(); |
|
99
|
|
|
|
|
|
|
} |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub with_http_cookie (&$$) { |
|
102
|
0
|
|
|
0
|
1
|
|
my ($code, $name => $value) = @_; |
|
103
|
0
|
|
|
|
|
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
|
104
|
0
|
|
|
|
|
|
local $Cookies = [@$Cookies, $name => $value]; |
|
105
|
0
|
|
|
|
|
|
$code->(); |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub with_http_header_field (&$$) { |
|
109
|
0
|
|
|
0
|
0
|
|
my ($code, $name, $body) = @_; |
|
110
|
0
|
|
|
|
|
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
|
111
|
0
|
|
|
|
|
|
local $HttpHeader = [@$HttpHeader, $name => $body]; |
|
112
|
0
|
|
|
|
|
|
$code->(); |
|
113
|
|
|
|
|
|
|
} |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub user_agent_name { |
|
116
|
0
|
|
|
0
|
0
|
|
my ($class, $type) = @_; |
|
117
|
0
|
|
|
|
|
|
return $user_agent_name->{$type}; |
|
118
|
|
|
|
|
|
|
} |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
1; |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
__END__ |