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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/11/27 Jakub Narebski <jnareb@xxxxxxxxx>:
> Jürgen Kreileder <jk@xxxxxxxxxxxx> 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.


> Reported-by: Jürgen Kreileder <jk@xxxxxxxxxxxx>
> Signed-off-by: Jakub Narębski <jnareb@xxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]