Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make detection of "Basic" case insenitive as perl RFC2617

  • Loading branch information...
commit 810548764dd48dc1c91e33111523b0d3a3fec2cd 1 parent d99efef
@2shortplanks 2shortplanks authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Plack/Middleware/Auth/Basic.pm
View
4 lib/Plack/Middleware/Auth/Basic.pm
@@ -22,7 +22,9 @@ sub call {
my $auth = $env->{HTTP_AUTHORIZATION}
or return $self->unauthorized;
- if ($auth =~ /^Basic (.*)$/) {
+ # note the 'i' on the regex, as, accoring to RFC2617 this is a
+ # "case-insensitive token to identify the authentication scheme"
+ if ($auth =~ /^Basic (.*)$/i) {
my($user, $pass) = split /:/, (MIME::Base64::decode($1) || ":");
$pass = '' unless defined $pass;
if ($self->authenticator->($user, $pass, $env)) {
Please sign in to comment.
Something went wrong with that request. Please try again.