git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gitweb: in-page errors don't work with mod_perl

From
Jürgen Kreileder <jk@blackdown.de>
Date
Nov 28, 2011, 00:20 UTC
Message-ID
<CAKD0UuwJoRkd7J06d2mFgyN0tO8p8ETPrwW5DqX12m+c_tQz4A@mail.gmail.com>
In-Reply-To
<m339d9mbiu.fsf@localhost.localdomain>
2011/11/27 Jakub Narebski <jnareb@gmail.com>:
Show 10 quoted lines
> Jürgen Kreileder <jk@blackdown.de> writes:
>
>> when gitweb.perl (208a1cc3d3) is run with mod_perl2 (2.0.5-2ubuntu1 on
>> Ubuntu 11.10) custom error pages don't work: Any page with status !=
>> 200 shows the plain Apache error document instead of a gitweb's error
>> page.
>
> Thanks for reporting it.  I wonder if it worked at all anytime...
>
> Anyway, does the following patch fixes this issue for you?

Not really. It does make the errors appear inline on the standard gitweb pages. But the HTTP status code is broken now: It's always 200 OK.

Show 26 quoted lines
> Reported-by: Jürgen Kreileder <jk@blackdown.de>
> Signed-off-by: Jakub Narębski <jnareb@gmail.com>
> ---
>  gitweb/gitweb.perl |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 4f0c3bd..f51cce1 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -1239,6 +1239,11 @@ sub run {
>
>  run();
>
> +if ($ENV{'MOD_PERL'}) {
> +       # mod_perl needs to be told that error page was already created
> +       my $r = $cgi->r;
> +       $r->status(200);
> +}
>  if (defined caller) {
>        # wrapped in a subroutine processing requests,
>        # e.g. mod_perl with ModPerl::Registry, or PSGI with Plack::App::WrapCGI
> --
> 1.7.6
>
>
Jürgen
Previous: Jakub NarebskiNext: Jürgen Kreileder
Message 3 of 8 in “gitweb: in-page errors don't work with mod_perl”
  1. Jürgen KreilederNov 27, 2011
  2. Jakub NarebskiNov 27, 2011
  3. Jürgen KreilederNov 28, 2011
  4. Jürgen KreilederNov 28, 2011
  5. Jürgen KreilederNov 28, 2011
  6. Jakub NarebskiNov 28, 2011
  7. Jürgen KreilederNov 28, 2011
  8. Jakub NarebskiNov 29, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.