]> Sergey Matveev's repositories - public-inbox.git/blob - lib/PublicInbox/URInntps.pm
add PublicInbox::URInntps package
[public-inbox.git] / lib / PublicInbox / URInntps.pm
1 # Copyright (C) 2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3
4 # deal with the lack of URI::nntps in upstream URI.
5 # nntps is IANA registered, snews is deprecated
6 # cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983419
7 package PublicInbox::URInntps;
8 use strict;
9 use parent qw(URI::snews);
10 use URI;
11
12 sub new {
13         my ($class, $url) = @_;
14         $url =~ m!\Anntps://!i ? bless(\$url, $class) : URI->new($url);
15 }
16
17 1;