From 2052e92ba1f75efca6935558ea01898d01751f40 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Sep 2019 10:48:25 +0000 Subject: wwwtext: support $INBOX_URL/_/text/config/raw This returns a git-config(1)-compatible file to make it easier to get started on mirroring an existing public-inbox. Omitting the "raw" from the URL works, as well, but I'm not sure if it's very useful. --- t/psgi_text.t | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/psgi_text.t') diff --git a/t/psgi_text.t b/t/psgi_text.t index 9979e7b3..bdc1ebfd 100644 --- a/t/psgi_text.t +++ b/t/psgi_text.t @@ -34,6 +34,13 @@ test_psgi(sub { $www->call(@_) }, sub { $res = $cb->(GET('/test/_/text/help/')); like($res->content, qr!public-inbox help.*!, 'default help'); + $res = $cb->(GET('/test/_/text/config/raw')); + my $f = "$tmpdir/cfg"; + open my $fh, '>', $f or die; + print $fh $res->content or die; + close $fh or die; + my $cfg = PublicInbox::Config->new($f); + is($cfg->{"$cfgpfx.address"}, $addr, 'got expected address in config'); }); done_testing(); -- cgit v1.2.3-24-ge0c7