Java Mailing List Archive

http://www.apache-httpd.com/

Home » modperl.perl »

Discuss new Handler that return Apache2::Const::OK even if the response
Status Code was changed to avoid default error pages

Keywan Ghadami

2009-12-20


Author LoginPost Reply
Hello I like to share a new mod perl handler that allow a perl script
to change the http status code of the response but sends it's own content instead of the apache default errorpages

The problem is discribed here:
http://mail-archives.apache.org/mod_mbox/perl-modperl/200803.mbox/%3C3892494C-8883-420A-928D-65FF674D5C99@(protected)

I made a very little change in the subrotuine default_handler of ModPerl::Registry module
  #...
  my $rc = $self->run;
  return $rc;
  #...

instead of returning the "$self->{REQ}->status"

I will not suggest this as patch for ModPerl::Registry because it's not realy a bug in ModPerl::Registry
module, it's just a decision of having the status handled by the apache web sever or within your perl script
But this Desision could be made automaticly if there is a way to check if the script printed out a http body already.

Any Ideas or Suggestions?



Best regads
Keywan Ghadami


©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.