]> Sergey Matveev's repositories - public-inbox.git/commitdiff
manifest.js.gz: fix per-inbox /$INBOX/manifest.js.gz
authorEric Wong <e@80x24.org>
Mon, 21 Dec 2020 19:41:21 +0000 (19:41 +0000)
committerEric Wong <e@80x24.org>
Mon, 21 Dec 2020 21:51:53 +0000 (21:51 +0000)
/$INBOX/manifest.js.gz should not attempt to match every inbox
in the domain (or every inbox); that is for /manifest.js.gz
(without a /$INBOX prefix).

Fixes: f303b4add8ea1883 ("wwwlisting: avoid hogging event loop")
lib/PublicInbox/ManifestJsGz.pm
lib/PublicInbox/WWW.pm

index 6d5b57eebc2e5c31db1496e982b41097f8e415fa..e02450fa6dee5bcd35aab49504f68c7a62a24e90 100644 (file)
@@ -99,4 +99,11 @@ sub psgi_triple {
                 'Content-Length', bytes::length($out) ], [ $out ] ]
 }
 
+sub per_inbox {
+       my ($ctx) = @_;
+       # only one inbox, slow is probably OK
+       slow_manifest_add($ctx, $ctx->{ibx});
+       psgi_triple($ctx);
+}
+
 1;
index a33d25abd44e314b489549a7ea08bb9ad7f4365e..52630ae3eccc4d48c734e9cceca0b587b4f4f7a7 100644 (file)
@@ -505,7 +505,7 @@ sub get_inbox_manifest ($$$) {
        my $r404 = invalid_inbox($ctx, $inbox);
        return $r404 if $r404;
        require PublicInbox::ManifestJsGz;
-       PublicInbox::ManifestJsGz->response($ctx);
+       PublicInbox::ManifestJsGz::per_inbox($ctx);
 }
 
 sub get_attach {