about summary refs log tree commit homepage
path: root/lib/PublicInbox/URInntps.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/URInntps.pm')
-rw-r--r--lib/PublicInbox/URInntps.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/PublicInbox/URInntps.pm b/lib/PublicInbox/URInntps.pm
new file mode 100644
index 00000000..88c8d641
--- /dev/null
+++ b/lib/PublicInbox/URInntps.pm
@@ -0,0 +1,18 @@
+# Copyright (C) all contributors <meta@public-inbox.org>
+# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+
+# deal with the lack of URI::nntps in upstream URI.
+# nntps is IANA registered, snews is deprecated
+# cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983419
+# Fixed in URI 5.08, we can drop this by 2035 when LTS distros all have it
+package PublicInbox::URInntps;
+use v5.12;
+use parent qw(URI::snews);
+use URI;
+
+sub new {
+        my ($class, $url) = @_;
+        $url =~ m!\Anntps://!i ? bless(\$url, $class) : URI->new($url);
+}
+
+1;