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   1393 use strict;
  26         49  
  26         802  
4 26     26   132 use warnings;
  26         59  
  26         1214  
5              
6             our $VERSION = '5.21';
7              
8 26     26   6444 use parent 'URI::_server';
  26         4543  
  26         142  
9              
10 24     24 1 74 sub default_port { 80 }
11              
12             sub canonical
13             {
14 354     354 1 585 my $self = shift;
15 354         753 my $other = $self->SUPER::canonical;
16              
17 354   66     721 my $slash_path = defined($other->authority) &&
18             !length($other->path) && !defined($other->query);
19              
20 354 100       747 if ($slash_path) {
21 9 50       36 $other = $other->clone if $other == $self;
22 9         27 $other->path("/");
23             }
24 354         887 $other;
25             }
26              
27             1;