line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SockJS::Middleware::JSessionID; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
66870
|
use strict; |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
435
|
use parent 'Plack::Middleware'; |
|
1
|
|
|
|
|
295
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
14922
|
use Plack::Util; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
188
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub call { |
11
|
3
|
|
|
3
|
1
|
6737
|
my $self = shift; |
12
|
3
|
|
|
|
|
7
|
my ($env) = @_; |
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
|
|
15
|
my $res = $self->app->(@_); |
15
|
3
|
50
|
|
|
|
47
|
return $res unless $env->{'sockjs.transport'}; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return $self->response_cb( |
18
|
|
|
|
|
|
|
$res => sub { |
19
|
3
|
|
|
3
|
|
56
|
my $res = shift; |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
8
|
my $h = Plack::Util::headers($res->[1]); |
22
|
|
|
|
|
|
|
|
23
|
3
|
100
|
|
|
|
81
|
if (my $cookie = $env->{HTTP_COOKIE}) { |
|
|
50
|
|
|
|
|
|
24
|
2
|
50
|
|
|
|
20
|
if ($cookie =~ m/(?:^|;|\s)JSESSIONID\s*=\s*(.+?)(?:\s|;|$)/) { |
25
|
2
|
|
|
|
|
30
|
$h->push('Set-Cookie' => "JSESSIONID=$1; Path=/"); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
elsif ($self->{cookie}) { |
29
|
1
|
|
|
|
|
16
|
$h->push('Set-Cookie' => 'JSESSIONID=dummy; Path=/'); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
3
|
|
|
|
|
19
|
); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |