Skip to content

Commit

Permalink
fix case when single-base vs multi-base
Browse files Browse the repository at this point in the history
  • Loading branch information
mose committed Jan 25, 2016
1 parent 743d965 commit 7915bf2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ def check_authorization
end

get '/' do
redirect "/#{File.basename(settings.configdata['basepath'])}"
if settings.basepaths
redirect "/#{File.basename(settings.configdata['basepath'])}"
else
@username = get_username
hieracles_config = prepare_base(nil, '/')
erb :home
end
end

get %r{/?([-_\.a-zA-Z0-9]+)?(/nodes)} do |e, r|
Expand Down Expand Up @@ -155,7 +161,7 @@ def check_authorization
get %r{/([-_\.a-zA-Z0-9]+)} do |e|
@username = get_username
hieracles_config = prepare_base(e, '/')
erb :home
erb :home
end

# debug pages --------------------
Expand Down

0 comments on commit 7915bf2

Please sign in to comment.