File Coverage

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


line stmt bran cond sub pod time code
1             package URI::http;
2              
3 30     30   360585 use strict;
  30         72  
  30         1047  
4 30     30   142 use warnings;
  30         85  
  30         2163  
5              
6             our $VERSION = '5.35';
7              
8 30     30   129 use parent 'URI::_server';
  30         36  
  30         191  
9              
10 44     44 1 101 sub default_port { 80 }
11              
12             sub canonical
13             {
14 372     372 1 549 my $self = shift;
15 372         759 my $other = $self->SUPER::canonical;
16              
17 372   66     598 my $slash_path = defined($other->authority) &&
18             !length($other->path) && !defined($other->query);
19              
20 372 100       690 if ($slash_path) {
21 23 100       58 $other = $other->clone if $other == $self;
22 23         94 $other->path("/");
23             }
24 372         766 $other;
25             }
26              
27             1;