diff options
author | Eric Wong <e@80x24.org> | 2021-02-24 17:31:51 +0600 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-02-24 23:26:12 +0000 |
commit | c1a92bf7adccea821a905b221972c06fc5579718 (patch) | |
tree | acf3ee6bcac0b91853126256b425546d1289273f /lib/PublicInbox/URInntps.pm | |
parent | 2d22af21032993d641554e6157166cb2a3c6f57b (diff) | |
download | public-inbox-c1a92bf7adccea821a905b221972c06fc5579718.tar.gz |
We prefer the IANA-registered form of URIs to avoid confusing users, but the URI package has yet to support it. cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983419
Diffstat (limited to 'lib/PublicInbox/URInntps.pm')
-rw-r--r-- | lib/PublicInbox/URInntps.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/PublicInbox/URInntps.pm b/lib/PublicInbox/URInntps.pm new file mode 100644 index 00000000..69fe7163 --- /dev/null +++ b/lib/PublicInbox/URInntps.pm @@ -0,0 +1,17 @@ +# Copyright (C) 2021 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 +package PublicInbox::URInntps; +use strict; +use parent qw(URI::snews); +use URI; + +sub new { + my ($class, $url) = @_; + $url =~ m!\Anntps://!i ? bless(\$url, $class) : URI->new($url); +} + +1; |