line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::MobileAgent::Request; |
2
|
9
|
|
|
9
|
|
46
|
use strict; |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
2547
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
sub new { |
5
|
566
|
|
|
566
|
0
|
668
|
my($class, $stuff) = @_; |
6
|
566
|
100
|
|
|
|
1638
|
if (!defined $stuff) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
7
|
519
|
|
|
|
|
2694
|
bless { env => \%ENV }, 'HTTP::MobileAgent::Request::Env'; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
elsif (UNIVERSAL::isa($stuff, 'Apache')) { |
10
|
1
|
|
|
|
|
6
|
bless { r => $stuff }, 'HTTP::MobileAgent::Request::Apache'; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
elsif (UNIVERSAL::isa($stuff, 'HTTP::Headers')) { |
13
|
1
|
|
|
|
|
6
|
bless { r => $stuff }, 'HTTP::MobileAgent::Request::HTTPHeaders'; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
else { |
16
|
45
|
|
|
|
|
278
|
bless { env => { HTTP_USER_AGENT => $stuff } }, 'HTTP::MobileAgent::Request::Env'; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
package HTTP::MobileAgent::Request::Env; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub get { |
23
|
1332
|
|
|
1332
|
|
1465
|
my($self, $header) = @_; |
24
|
1332
|
|
|
|
|
1637
|
$header =~ tr/-/_/; |
25
|
1332
|
|
|
|
|
5442
|
return $self->{env}->{"HTTP_" . uc($header)}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
package HTTP::MobileAgent::Request::Apache; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub get { |
31
|
3
|
|
|
3
|
|
5
|
my($self, $header) = @_; |
32
|
3
|
|
|
|
|
10
|
return $self->{r}->header_in($header); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
package HTTP::MobileAgent::Request::HTTPHeaders; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub get { |
38
|
3
|
|
|
3
|
|
4
|
my($self, $header) = @_; |
39
|
3
|
|
|
|
|
12
|
return $self->{r}->header($header); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |