line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::DigestAuth::Util; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
1766256
|
use strict; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
186
|
|
4
|
7
|
|
|
7
|
|
25
|
use warnings; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
148
|
|
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
517
|
use Mojo::Util qw{md5_sum unquote}; |
|
7
|
|
|
|
|
46279
|
|
|
7
|
|
|
|
|
430
|
|
7
|
7
|
|
|
7
|
|
34
|
use base 'Exporter'; |
|
7
|
|
|
|
|
4
|
|
|
7
|
|
|
|
|
1487
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @EXPORT_OK = qw{checksum parse_header}; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub checksum |
12
|
|
|
|
|
|
|
{ |
13
|
373
|
|
|
373
|
0
|
5326
|
md5_sum join ':', grep(defined, @_); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub parse_header |
17
|
|
|
|
|
|
|
{ |
18
|
72
|
|
|
72
|
0
|
107667
|
my $header = shift; |
19
|
72
|
|
|
|
|
111
|
my $parsed; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# TODO: I think there's a browser with a quoting issue that might affect this |
22
|
72
|
100
|
66
|
|
|
656
|
if($header && $header =~ s/^Digest\s//) { |
23
|
71
|
|
|
|
|
463
|
while($header =~ /([a-zA-Z]+)=(".*?"|[^,]+)/g){ |
24
|
578
|
|
|
|
|
4554
|
$parsed->{$1} = unquote($2); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
72
|
|
|
|
|
580
|
$parsed; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |