| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Dancer2::Core::Role::StandardResponses; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: Role to provide commonly used responses |
|
3
|
|
|
|
|
|
|
$Dancer2::Core::Role::StandardResponses::VERSION = '2.1.0'; |
|
4
|
148
|
|
|
148
|
|
959758
|
use Moo::Role; |
|
|
148
|
|
|
|
|
14836
|
|
|
|
148
|
|
|
|
|
1346
|
|
|
5
|
148
|
|
|
148
|
|
90235
|
use Dancer2::Core::HTTP; |
|
|
148
|
|
|
|
|
442
|
|
|
|
148
|
|
|
|
|
28666
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub response { |
|
8
|
2
|
|
|
2
|
1
|
46764
|
my ( $self, $app, $code, $message ) = @_; |
|
9
|
2
|
|
|
|
|
14
|
$app->response->status($code); |
|
10
|
2
|
|
|
|
|
6578
|
$app->response->header( 'Content-Type', 'text/plain' ); |
|
11
|
2
|
|
|
|
|
10021
|
return $message; |
|
12
|
|
|
|
|
|
|
} |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub standard_response { |
|
15
|
1
|
|
|
1
|
1
|
5268
|
my ( $self, $app, $status_code ) = @_; |
|
16
|
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
13
|
return $self->response( |
|
18
|
|
|
|
|
|
|
$app, |
|
19
|
|
|
|
|
|
|
$status_code, |
|
20
|
|
|
|
|
|
|
Dancer2::Core::HTTP->status_message($status_code), |
|
21
|
|
|
|
|
|
|
); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |