Changeset 1753

Show
Ignore:
Timestamp:
01/15/06 06:36:30
Author:
miyagawa
Message:

username and password can be 0; updated document

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • HTTP-Server-Simple-Authen/trunk/Changes

    r1752 r1753  
    11Revision history for Perl extension HTTP::Server::Simple::Authen 
     2 
     30.02  2006-01-14T21:34:25Z 
     4        - Fixed a bug that you can't use 0 as username or password 
     5        - Updated document 
    26 
    370.01  Sat Jan 14 17:15:45 2006 
  • HTTP-Server-Simple-Authen/trunk/MANIFEST

    r1752 r1753  
    55server.pl 
    66t/00_compile.t 
     7META.yml                                 Module meta-data (added by MakeMaker) 
  • HTTP-Server-Simple-Authen/trunk/lib/HTTP/Server/Simple/Authen.pm

    r1752 r1753  
    22 
    33use strict; 
    4 our $VERSION = '0.01'; 
     4our $VERSION = '0.02'; 
    55 
    66use Carp; 
     
    1212    my($cgi) = @_; 
    1313    if (($ENV{HTTP_AUTHORIZATION} || '') =~ /^Basic (.*?)$/) { 
    14         my $credential = $1; 
    15         my($user, $pass) = split /:/, MIME::Base64::decode($1); 
    16         return $self->authen_handler->authenticate($user || '', $pass || '') 
     14        my($user, $pass) = split /:/, (MIME::Base64::decode($1) || ':'); 
     15        return $self->authen_handler->authenticate($user, $pass) 
    1716            && $self->authorize_user($user); 
    1817    } 
     
    8685=item needs_authen 
    8786 
    88 Returns true if the request needs authentication. Takes C<$cgi> 
    89 parameter as parameter. Default to return 1 (which means all th
    90 requests should be authenticated). 
     87Returns true if the request needs authentication. Takes C<$cgi> as a 
     88parameter. Default to return 1 (which means all the requests should b
     89authenticated). 
    9190 
    9291For example, you can use the following code to authenticate URL under