line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::DigestAuth::Util; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
3990947
|
use strict; |
|
7
|
|
|
|
|
65
|
|
|
7
|
|
|
|
|
219
|
|
4
|
7
|
|
|
7
|
|
42
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
215
|
|
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
623
|
use Mojo::Util qw{md5_sum unquote}; |
|
7
|
|
|
|
|
196282
|
|
|
7
|
|
|
|
|
515
|
|
7
|
7
|
|
|
7
|
|
60
|
use base 'Exporter'; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
2242
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @EXPORT_OK = qw{checksum parse_header}; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub checksum |
12
|
|
|
|
|
|
|
{ |
13
|
373
|
|
|
373
|
0
|
9466
|
md5_sum join ':', grep(defined, @_); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub parse_header |
17
|
|
|
|
|
|
|
{ |
18
|
72
|
|
|
72
|
0
|
148157
|
my $header = shift; |
19
|
72
|
|
|
|
|
143
|
my $parsed; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# TODO: I think there's a browser with a quoting issue that might affect this |
22
|
72
|
100
|
66
|
|
|
715
|
if($header && $header =~ s/^Digest\s//) { |
23
|
71
|
|
|
|
|
584
|
while($header =~ /([a-zA-Z]+)=(".*?"|[^,]+)/g){ |
24
|
578
|
|
|
|
|
7612
|
$parsed->{$1} = unquote($2); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
72
|
|
|
|
|
978
|
$parsed; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |