Skip to content

Commit

Permalink
Add HTTP Basic authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcristo committed Apr 18, 2023
1 parent d2f43fe commit e39936a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ require 'net/http'

use Rack::Static, :root => 'public'

use Rack::Auth::Basic do |username, password|
ENV['HTTP_BASIC_AUTH_PASSWORD'].present? &&
username == 'user' &&
password == ENV['HTTP_BASIC_AUTH_PASSWORD']
end

app = lambda do |env|
request_uri = env['REQUEST_URI']

Expand Down

0 comments on commit e39936a

Please sign in to comment.