Merge pull request #42 from aladagemre/patch-1

Realm added for Basic Authentication
This commit is contained in:
Serdar Dogruyol 2016-01-04 20:28:05 +02:00
commit 2585d97a58

View file

@ -22,7 +22,9 @@ module Kemal::Middleware
end end
end end
end end
HTTP::Response.new(401, "Unauthorized") headers = HTTP::Headers.new
headers["WWW-Authenticate"] = "Basic realm=\"Login Required\""
HTTP::Response.new(401, "Could not verify your access level for that URL.\nYou have to login with proper credentials", headers, nil, "HTTP/1.1", nil)
end end
def authorized?(value) def authorized?(value)