File Coverage

blib/lib/URI/http.pm
Criterion Covered Total %
statement 17 17 100.0
branch 3 4 75.0
condition 2 3 66.6
subroutine 5 5 100.0
pod 2 2 100.0
total 29 31 93.5


line stmt bran cond sub pod time code
1             package URI::http;
2              
3 26     26   1414 use strict;
  26         49  
  26         801  
4 26     26   161 use warnings;
  26         49  
  26         1095  
5              
6             our $VERSION = '5.20';
7              
8 26     26   6403 use parent 'URI::_server';
  26         4600  
  26         135  
9              
10 24     24 1 66 sub default_port { 80 }
11              
12             sub canonical
13             {
14 354     354 1 599 my $self = shift;
15 354         747 my $other = $self->SUPER::canonical;
16              
17 354   66     757 my $slash_path = defined($other->authority) &&
18             !length($other->path) && !defined($other->query);
19              
20 354 100       776 if ($slash_path) {
21 9 50       34 $other = $other->clone if $other == $self;
22 9         24 $other->path("/");
23             }
24 354         895 $other;
25             }
26              
27             1;