Permalink
Browse files

ignore defined but empty ENV['PORT']

  • Loading branch information...
noxqsgit
noxqsgit committed Mar 25, 2013
1 parent 96da46c commit 824fe5c752bebd8a5de30a934bc9852341d2b854
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sinatra/base.rb
View
@@ -1795,7 +1795,7 @@ class << self
set :running, false # is the built-in server running now?
set :server, %w[HTTP webrick]
set :bind, Proc.new { development? ? 'localhost' : '0.0.0.0' }
- set :port, Integer(ENV['PORT'] || 4567)
+ set :port, Integer(ENV['PORT'] && !ENV['PORT'].empty? ? ENV['PORT'] : 4567)
ruby_engine = defined?(RUBY_ENGINE) && RUBY_ENGINE

0 comments on commit 824fe5c

Please sign in to comment.