Skip to content

Commit

Permalink
B #3751: validate by APP_ENV (#4015)
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
(cherry picked from commit f141633)
  • Loading branch information
jloboescalona2 authored and tinova committed Dec 3, 2019
1 parent ddc44de commit 333feca
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sunstone/sunstone-server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@
ENV['NO_PROXY'] = no_proxy
end

if ENV["APP_ENV"] &&
!ENV["APP_ENV"].empty? &&
%w{production development test}.include?(ENV["APP_ENV"])
set :environment, ENV["APP_ENV"].to_sym
else
case $conf[:env]
when "dev"
set :environment, :development
else
set :environment, :production
end
end

case $conf[:sessions]
when 'memory', nil
use Rack::Session::Pool, :key => 'sunstone'
Expand Down

0 comments on commit 333feca

Please sign in to comment.