* [PATCH 4/5] www: cgit: fix fallback to WwwCoderepo on array responses
2022-10-08 8:24 5% [PATCH 0/5] www: some coderepo stuff Eric Wong
@ 2022-10-08 8:24 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2022-10-08 8:24 UTC (permalink / raw)
To: meta
For fast PSGI responses which don't require returning a coderef,
just reuse qspawn.wcb directly on the arrayref to avoid an undef
$wcb from firing in psgi_return_init_cb.
I only noticed this because the ViewVCS search form is broken
for /$CODEREPO/$OID/s/ endpoints at the moment.
---
lib/PublicInbox/GitHTTPBackend.pm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm
index 61a13560..3aae5454 100644
--- a/lib/PublicInbox/GitHTTPBackend.pm
+++ b/lib/PublicInbox/GitHTTPBackend.pm
@@ -155,7 +155,11 @@ sub parse_cgi_headers {
delete $ctx->{env}->{'qspawn.wcb'};
$ctx->{env}->{'plack.skip-deflater'} = 1; # prevent 2x gzip
my $res = $ctx->{www}->coderepo->srv(\%ctx);
- $res->(delete $ctx{env}->{'qspawn.wcb'}) if ref($res) eq 'CODE';
+ if (ref($res) eq 'CODE') {
+ $res->(delete $ctx{env}->{'qspawn.wcb'});
+ } else { # ref($res) eq 'ARRAY'
+ $ctx->{env}->{'qspawn.wcb'} = $ctx{env}->{'qspawn.wcb'};
+ }
$res; # non ARRAY ref for ->psgi_return_init_cb
} else {
[ $code, \@h ]
^ permalink raw reply related [relevance 7%]
* [PATCH 0/5] www: some coderepo stuff
@ 2022-10-08 8:24 5% Eric Wong
2022-10-08 8:24 7% ` [PATCH 4/5] www: cgit: fix fallback to WwwCoderepo on array responses Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2022-10-08 8:24 UTC (permalink / raw)
To: meta
5/5 is clearly incomplete, but it's nicer than broken
links before in $CODEREPO/$OID/s/ endpoints.
Deployed to https://yhbt.net/lore/git.git/<COMMIT_OID>/s/#related
Eric Wong (5):
config: remove {-cgitrc_unparsed} field
www_coderepo: wire up snapshots from summary
www_coderepo: update blurb on the goal/purpose of this
www: cgit: fix fallback to WwwCoderepo on array responses
www_coderepo: allow searching one extindex|inbox
Documentation/public-inbox-config.pod | 4 +++
lib/PublicInbox/Config.pm | 9 ++++-
lib/PublicInbox/GitHTTPBackend.pm | 6 +++-
lib/PublicInbox/Inbox.pm | 3 +-
lib/PublicInbox/RepoSnapshot.pm | 4 ++-
lib/PublicInbox/ViewVCS.pm | 31 ++++++++++++++---
lib/PublicInbox/WwwCoderepo.pm | 50 +++++++++++++++++++++++----
t/solver_git.t | 6 ++++
8 files changed, 99 insertions(+), 14 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-10-08 8:24 5% [PATCH 0/5] www: some coderepo stuff Eric Wong
2022-10-08 8:24 7% ` [PATCH 4/5] www: cgit: fix fallback to WwwCoderepo on array responses Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).