]> Sergey Matveev's repositories - public-inbox.git/blob - lib/PublicInbox/URInntps.pm
imap+nntp: share COMPRESS implementation
[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 # Fixed in URI 5.08, we can drop this by 2035 when LTS distros all have it
8 package PublicInbox::URInntps;
9 use strict;
10 use parent qw(URI::snews);
11 use URI;
12
13 sub new {
14         my ($class, $url) = @_;
15         $url =~ m!\Anntps://!i ? bless(\$url, $class) : URI->new($url);
16 }
17
18 1;