Using plus (+) in list name
Eric Wong
e@80x24.org
Sun Aug 21 22:11:43 GMT 2022
Mark Wielaard <mark@klomp.org> wrote:
> On Sun, Aug 21, 2022 at 08:53:38PM +0000, Eric Wong via Overseers wrote:
> > Mark Wielaard <mark@klomp.org> wrote:
> > Interesting that NNTP and IMAP work (I wasn't expecting it :x).
> >
> > I can't remember off the top of my head, but is '+' allowed by
> > the relevant NNTP and List-Id RFCs?
>
> I don't know. I just observed that I can see the group name
> inbox.gcc.libstdc++ in my nttp and imap readers when pointing at
> inbox.sourceware.org.
I suppose it's OK as long as real-world clients are happy.
> > +++ b/lib/PublicInbox/WWW.pm
> > @@ -23,7 +23,7 @@ use PublicInbox::WwwStatic qw(r path_info_raw);
> > use PublicInbox::Eml;
> >
> > # TODO: consider a routing tree now that we have more endpoints:
> > -our $INBOX_RE = qr!\A/([\w\-][\w\.\-]*)!;
> > +our $INBOX_RE = qr!\A/([\w\-][\w\.\-\+]*)!;
> > our $MID_RE = qr!([^/]+)!;
> > our $END_RE = qr!(T/|t/|t\.mbox(?:\.gz)?|t\.atom|raw|)!;
> > our $ATTACH_RE = qr!([0-9][0-9\.]*)-($PublicInbox::Hval::FN)!;
>
> That works! https://inbox.sourceware.org/libstdc++ looks fully
> functional now.
Good to know. I'll make a patch ASAP and maybe some tests
down-the-line...
> Now to figure out how to properly include that patch before the other
> sourceware overseers figure out I patched the packaged code in place.
If you're using a .psgi config file to customize the middleware
layer, you should be able to access `our' vars through it:
diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi
index e017b2fb..36cd8b57 100644
--- a/examples/public-inbox.psgi
+++ b/examples/public-inbox.psgi
@@ -14,6 +14,7 @@ use strict;
use warnings;
use PublicInbox::WWW;
use Plack::Builder;
+$PublicInbox::WWW::INBOX_RE = qr!\A/([\w\-][\w\.\-\+]*)!;
my $www = PublicInbox::WWW->new;
$www->preload;
There's a bunch of `our' vars which happens to be accessible across
namespaces, some with the intent of being tweaked by end users,
some for internal-use only.
I can't remember what reasoning I had for making $INBOX_RE
globally-accessible, but I'm fine with it used in this way.
More information about the Overseers
mailing list