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 29     29   449584 use strict;
  29         72  
  29         1323  
4 29     29   138 use warnings;
  29         55  
  29         2685  
5              
6             our $VERSION = '5.34';
7              
8 29     29   185 use parent 'URI::_server';
  29         46  
  29         257  
9              
10 28     28 1 148 sub default_port { 80 }
11              
12             sub canonical
13             {
14 355     355 1 605 my $self = shift;
15 355         884 my $other = $self->SUPER::canonical;
16              
17 355   66     688 my $slash_path = defined($other->authority) &&
18             !length($other->path) && !defined($other->query);
19              
20 355 100       857 if ($slash_path) {
21 9 50       30 $other = $other->clone if $other == $self;
22 9         21 $other->path("/");
23             }
24 355         1020 $other;
25             }
26              
27             1;