line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Middleware::Session::RemoveCookies; |
2
|
|
|
|
|
|
|
# ABSTRACT: remove cookies from the requests |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.02'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
24940
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
85
|
|
7
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
8
|
2
|
|
|
2
|
|
2019
|
use Plack::Request; |
|
2
|
|
|
|
|
153892
|
|
|
2
|
|
|
|
|
71
|
|
9
|
2
|
|
|
2
|
|
1559
|
use HTTP::Headers::Util qw(join_header_words); |
|
2
|
|
|
|
|
1686
|
|
|
2
|
|
|
|
|
146
|
|
10
|
2
|
|
|
2
|
|
932
|
use Plack::Util::Accessor 'key'; |
|
2
|
|
|
|
|
8596
|
|
|
2
|
|
|
|
|
23
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
108
|
use parent 'Plack::Middleware'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
17
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub call { |
15
|
1
|
|
|
1
|
1
|
174
|
my ( $self, $env ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
1
|
50
|
|
|
|
8
|
if ( $env->{'HTTP_COOKIE'} ) { |
18
|
1
|
|
|
|
|
8
|
my $cookie = Plack::Request->new($env)->cookies; |
19
|
1
|
|
|
|
|
120
|
foreach my $c_key ( keys %$cookie ) { |
20
|
2
|
100
|
|
|
|
110
|
delete $cookie->{$c_key} if $c_key =~ $self->key; |
21
|
|
|
|
|
|
|
} |
22
|
1
|
|
|
|
|
14
|
$env->{'plack.cookie.string'} = $env->{'HTTP_COOKIE'} |
23
|
|
|
|
|
|
|
= join_header_words(%$cookie); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
32
|
return $self->app->($env); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |