Encapsulate logic for determining if an SSL request has been made.

Refactor core modules to use that.
This commit is contained in:
Colin Kuskie 2009-08-19 18:25:00 +00:00
parent 39127b7ec0
commit 1c9908f490
5 changed files with 23 additions and 17 deletions

View file

@ -43,7 +43,7 @@ These methods are available from this package:
=head2 callerIsSearchSite ( )
returns true if the remote address matches a site which is a known indexer or spider.
Returns true if the remote address matches a site which is a known indexer or spider.
=cut
@ -65,7 +65,8 @@ sub callerIsSearchSite {
=head2 clientIsSpider ( )
returns true is the client/agent is a spider/indexer or some other non-human interface
Returns true is the client/agent is a spider/indexer or some other non-human interface, determined
by checking the user agent against a list of known spiders.
=cut
@ -166,7 +167,7 @@ sub new {
=head2 requestNotViewed ( )
returns true is the client/agent is a spider/indexer or some other non-human interface
Returns true is the client/agent is a spider/indexer or some other non-human interface
=cut
@ -181,6 +182,19 @@ sub requestNotViewed {
}
#-------------------------------------------------------------------
=head2 sslRequest ( )
Returns true if a https request was made.
=cut
sub sslRequest {
my $self = shift;
return ($self->get('HTTPS') eq 'on' || $self->get('SSLPROXY') ? 1 : 0);
}
1;