Common/URI/http.pm

filter: Statementstmt 100% 26 / 26 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 32 / 32 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Common/URI/file.pm ↑ Summary Common/URI/news.pm »
1 package Regexp::Common::URI::http;
2  
3 71 ▶use Regexp::Common qw /pattern clean no_defaults/;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 71 ▶use Regexp::Common::URI qw /register_uri/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 71 ▶use Regexp::Common::URI::RFC2396 qw /$host $port $path_segments $query/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 71 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 71 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 71 our $VERSION = '2024080801';
11  
12  
13 71 my $http_uri = "(?k:(?k:http)://(?k:$host)(?::(?k:$port))?" .
14 "(?k:/(?k:(?k:$path_segments)(?:[?](?k:$query))?))?)";
15  
16 71 my $https_uri = $http_uri; $https_uri =~ s/http/https?/;
17  
18 71 register_uri HTTP => $https_uri;
19  
20 pattern name => [qw (URI HTTP), "-scheme=http"],
21 18482 ▶ create => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
22 18482 my $scheme = $_ [1] -> {-scheme};
23 18482 my $uri = $http_uri;
24 18482 $uri =~ s/http/$scheme/;
25 18482 $uri;
26 }
27 71 ;
28  
29 71 1;
30  
31 __END__
« Common/URI/file.pm ↑ Summary Common/URI/news.pm »