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 25     25   1383 use strict;
  25         44  
  25         823  
4 25     25   128 use warnings;
  25         48  
  25         1070  
5              
6             our $VERSION = '5.19';
7              
8 25     25   5776 use parent 'URI::_server';
  25         4228  
  25         159  
9              
10 24     24 1 62 sub default_port { 80 }
11              
12             sub canonical
13             {
14 353     353 1 605 my $self = shift;
15 353         755 my $other = $self->SUPER::canonical;
16              
17 353   66     775 my $slash_path = defined($other->authority) &&
18             !length($other->path) && !defined($other->query);
19              
20 353 100       756 if ($slash_path) {
21 9 50       31 $other = $other->clone if $other == $self;
22 9         25 $other->path("/");
23             }
24 353         975 $other;
25             }
26              
27             1;