summaryrefslogtreecommitdiff
path: root/lib/URI/http.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/URI/http.pm')
-rw-r--r--lib/URI/http.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/URI/http.pm b/lib/URI/http.pm
new file mode 100644
index 0000000..a7e921a
--- /dev/null
+++ b/lib/URI/http.pm
@@ -0,0 +1,27 @@
+package URI::http;
+
+use strict;
+use warnings;
+
+our $VERSION = "1.69";
+
+use parent 'URI::_server';
+
+sub default_port { 80 }
+
+sub canonical
+{
+ my $self = shift;
+ my $other = $self->SUPER::canonical;
+
+ my $slash_path = defined($other->authority) &&
+ !length($other->path) && !defined($other->query);
+
+ if ($slash_path) {
+ $other = $other->clone if $other == $self;
+ $other->path("/");
+ }
+ $other;
+}
+
+1;