summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Etheridge <ether@cpan.org>2021-02-26 14:46:36 -0800
committerKaren Etheridge <ether@cpan.org>2021-02-26 15:39:51 -0800
commit09f979eabbe7da787297c34b4336aeb8c6a34c2f (patch)
treebc1860bcf14c11512f3572e34a3e567c0a671712
parent6b80838c7a511ddb31618030782cecadc998c8e7 (diff)
downloaduri-09f979eabbe7da787297c34b4336aeb8c6a34c2f.tar.gz
add URI::nntps (closes #82)
-rw-r--r--Changes1
-rw-r--r--lib/URI.pm4
-rw-r--r--lib/URI/nntps.pm14
-rw-r--r--t/news.t8
4 files changed, 26 insertions, 1 deletions
diff --git a/Changes b/Changes
index db8bca8..d3f07c2 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Revision history for URI
{{$NEXT}}
+ - added URI::nntps (GH#82)
5.07 2021-01-29 22:52:20Z
- s/perl.com/example.com/ in examples and tests (GH#81) (Olaf Alders)
diff --git a/lib/URI.pm b/lib/URI.pm
index fcfbb21..174db22 100644
--- a/lib/URI.pm
+++ b/lib/URI.pm
@@ -926,6 +926,10 @@ access the path: $uri->group and $uri->message.
See I<news> scheme.
+=item B<nntps>:
+
+See I<news> scheme.
+
=item B<pop>:
The I<pop> URI scheme is specified in RFC 2384. The scheme is used to
diff --git a/lib/URI/nntps.pm b/lib/URI/nntps.pm
new file mode 100644
index 0000000..bf7d9c8
--- /dev/null
+++ b/lib/URI/nntps.pm
@@ -0,0 +1,14 @@
+package URI::nntps;
+
+use strict;
+use warnings;
+
+our $VERSION = '5.08';
+
+use parent 'URI::nntp';
+
+sub default_port { 563 }
+
+sub secure { 1 }
+
+1;
diff --git a/t/news.t b/t/news.t
index 947697f..e1c9b2a 100644
--- a/t/news.t
+++ b/t/news.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-print "1..7\n";
+print "1..8\n";
use URI ();
@@ -49,3 +49,9 @@ print "not " unless $u->group eq "no.perl" &&
$u->port == 563;
print "ok 7\n";
+$u = URI->new("nntps://nntps.online.no/no.perl");
+
+print "not " unless $u->group eq "no.perl" &&
+ $u->host eq "nntps.online.no" &&
+ $u->port == 563;
+print "ok 8\n";