Skip to content
This repository
Browse code

make detection of "Basic" case insenitive as perl RFC2617

  • Loading branch information...
commit 810548764dd48dc1c91e33111523b0d3a3fec2cd 1 parent d99efef
Mark Fowler 2shortplanks authored

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. +3 1 lib/Plack/Middleware/Auth/Basic.pm
4 lib/Plack/Middleware/Auth/Basic.pm
@@ -22,7 +22,9 @@ sub call {
22 22 my $auth = $env->{HTTP_AUTHORIZATION}
23 23 or return $self->unauthorized;
24 24
25   - if ($auth =~ /^Basic (.*)$/) {
  25 + # note the 'i' on the regex, as, accoring to RFC2617 this is a
  26 + # "case-insensitive token to identify the authentication scheme"
  27 + if ($auth =~ /^Basic (.*)$/i) {
26 28 my($user, $pass) = split /:/, (MIME::Base64::decode($1) || ":");
27 29 $pass = '' unless defined $pass;
28 30 if ($self->authenticator->($user, $pass, $env)) {

0 comments on commit 8105487

Please sign in to comment.
Something went wrong with that request. Please try again.