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>
  • Loading branch information
jloboescalona2 authored and Tino V谩zquez committed Dec 3, 2019
1 parent bd17138 commit f141633
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sunstone/sunstone-server.rb
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 f141633

Please sign in to comment.