Changeset 2026

Show
Ignore:
Timestamp:
11/23/2007 03:23:35 PM (8 months ago)
Author:
jan
Message:

fixed case-sensitive match of auth-method (fixes #1456)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/lighttpd-1.4.x/NEWS

    r2024 r2026  
    99  * added support for matching $HTTP["scheme"] in configs 
    1010  * fixed initgroups() called after chroot (#1384) 
     11  * fixed case-sensitive check for Auth-Method (#1456) 
    1112  * execute fcgi app without /bin/sh if used as argument to spawn-fcgi (#1428) 
    1213 
  • branches/lighttpd-1.4.x/src/mod_auth.c

    r1938 r2026  
    239239 
    240240                        if ((auth_type_len == 5) && 
    241                             (0 == strncmp(http_authorization, "Basic", auth_type_len))) { 
     241                            (0 == strncasecmp(http_authorization, "Basic", auth_type_len))) { 
    242242 
    243243                                if (0 == strcmp(method->value->ptr, "basic")) { 
     
    245245                                } 
    246246                        } else if ((auth_type_len == 6) && 
    247                                    (0 == strncmp(http_authorization, "Digest", auth_type_len))) { 
     247                                   (0 == strncasecmp(http_authorization, "Digest", auth_type_len))) { 
    248248                                if (0 == strcmp(method->value->ptr, "digest")) { 
    249249                                        if (-1 == (auth_satisfied = http_auth_digest_check(srv, con, p, req, con->uri.path, auth_realm+1))) { 
  • branches/lighttpd-1.4.x/tests/mod-auth.t

    r1875 r2026  
    99use strict; 
    1010use IO::Socket; 
    11 use Test::More tests => 13
     11use Test::More tests => 14
    1212use LightyTest; 
    1313 
     
    4848$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; 
    4949ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (des)'); 
     50 
     51$t->{REQUEST}  = ( <<EOF 
     52GET /server-config HTTP/1.0 
     53Host: auth-htpasswd.example.org 
     54Authorization: basic ZGVzOmRlcw== 
     55EOF 
     56 ); 
     57$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; 
     58ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (des) (lowercase)'); 
     59 
    5060 
    5161SKIP: {