line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alice::HTTP::Request; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1121
|
use Alice::HTTP::Response; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
56
|
|
4
|
2
|
|
|
2
|
|
14
|
use Encode; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
162
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use parent 'Plack::Request'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
19
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
0
|
|
|
0
|
1
|
|
my($class, $env, $cb) = @_; |
10
|
|
|
|
|
|
|
|
11
|
0
|
0
|
0
|
|
|
|
Carp::croak(q{$env is required}) |
12
|
|
|
|
|
|
|
unless defined $env && ref($env) eq 'HASH'; |
13
|
0
|
0
|
0
|
|
|
|
Carp::croak(q{$cb is required}) |
14
|
|
|
|
|
|
|
unless defined $cb && ref($cb) eq 'CODE'; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
bless { env => $env, cb => $cb }, $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new_response { |
20
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
21
|
0
|
|
|
|
|
|
Alice::HTTP::Response->new($self->{cb}, @_); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub param { |
25
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
26
|
0
|
0
|
|
|
|
|
if (wantarray) { |
27
|
0
|
|
|
|
|
|
return map {decode("utf8", $_)} $self->SUPER::param(@_); |
|
0
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
else { |
30
|
0
|
|
|
|
|
|
return decode("utf8", $self->SUPER::param(@_)); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |