Skip to content

Commit

Permalink
Use presence to avoid vals set to empty strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
christiannelson committed May 11, 2016
1 parent 13adf34 commit d5f9aa2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config.ru
Expand Up @@ -3,11 +3,11 @@
require ::File.expand_path('../config/environment', __FILE__)

# Redirect to the custom (canonical) hostname.
use Rack::CanonicalHost, ENV['HOSTNAME'] if ENV['HOSTNAME']
use Rack::CanonicalHost, ENV['HOSTNAME'] if ENV['HOSTNAME'].present?

# Optional Basic Auth - Enabled if BASIC_AUTH_PASSWORD is set. User is optional (any value will be accepted).
BASIC_AUTH_USER = ENV['BASIC_AUTH_USER']
BASIC_AUTH_PASSWORD = ENV['BASIC_AUTH_PASSWORD']
BASIC_AUTH_USER = ENV['BASIC_AUTH_USER'].presence
BASIC_AUTH_PASSWORD = ENV['BASIC_AUTH_PASSWORD'].presence

if BASIC_AUTH_PASSWORD
use Rack::Auth::Basic do |username, password|
Expand Down

0 comments on commit d5f9aa2

Please sign in to comment.