cgi-bin/DW/Hooks/SSL.pm
author fu
Thu Feb 23 02:21:54 2012 +0800
changeset 4315 34b3c4ba3afb
parent 656 6cc447870adb
permissions -rw-r--r--
http://bugs.dwscoalition.org/show_bug.cgi?id=3859

Tweak for grammar / clarity / wording.

Patch by fu.
     1 #
     2 # Use this hook to turn on SSL mode if a certain header is present.  See the
     3 # SSL documentation for more information on usage.
     4 #
     5 # Authors:
     6 #      Mark Smith <mark@dreamwidth.org>
     7 #
     8 # Copyright (c) 2009 by Dreamwidth Studios, LLC.
     9 #
    10 # This program is free software; you may redistribute it and/or modify it under
    11 # the same terms as Perl itself.  For a copy of the license, please reference
    12 # 'perldoc perlartistic' or 'perldoc perlgpl'.
    13 #
    14 
    15 package DW::Hooks::SSL;
    16 
    17 use strict;
    18 use LJ::Hooks;
    19 
    20 LJ::Hooks::register_hook( 'ssl_check', sub {
    21     my $r = $_[0]->{r}
    22         or return 0;
    23 
    24     return 1 if $LJ::SSL_HEADER &&
    25                 $r->headers_in->{$LJ::SSL_HEADER} == 1;
    26     return 0;
    27 } );
    28 
    29 1;