All pastes #275335 Raw Edit

DeAuth.pm

public text v1 · immutable
·published 2006-12-11 13:24 UTC
rendered paste body
package ApachePerl::DeAuth;

use strict;
use warnings;

use Apache2::Const -compile => qw(OK DECLINED);
use Apache2::Log ();

use Apache2::ServerUtil ();
use Apache2::Access ();
use Apache2::RequestRec qw(:all);
use Apache2::RequestUtil;
use Apache2::Reload;
use APR::Table;

sub handler
  {
  my $r=shift;
  my $s=$r->server;
  my $uri=$r->uri;
  my $regex= $r->dir_config("DeAuthUris");
  
  if ($uri =~ $regex)
    {
    delete $r->headers_in->{"Authorization"};
    $s->log_error("DeAuth.pm : Deleted Unnecessary Authorization field for Unprotected Location $uri");
    }
  return Apache2::Const::OK;
  } 1;
__END__