Skip to content

Loading…

please ignore defined but empty ENV['PORT'] #698

Merged
merged 1 commit into from

2 participants

@noxqsgit

See #697

- Felix

@rkh rkh merged commit 49edbc2 into sinatra:master

1 check was pending

Details default The Travis build is in progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2013
  1. ignore defined but empty ENV['PORT']

    noxqsgit committed
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sinatra/base.rb
View
2 lib/sinatra/base.rb
@@ -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
Something went wrong with that request. Please try again.