You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/03/04 19:01:02 UTC
[whimsy.git] [1/1] Commit bc789d3: redirect if slash isn't present
Commit bc789d3a00b113ed560812d63c0119d08cf7c3fa:
redirect if slash isn't present
Branch: refs/heads/master
Author: Sam Ruby <ru...@intertwingly.net>
Committer: Sam Ruby <ru...@intertwingly.net>
Pusher: rubys <ru...@apache.org>
------------------------------------------------------------
www/roster/main.rb | ++++++ -----
------------------------------------------------------------
21 changes: 12 additions, 9 deletions.
------------------------------------------------------------
diff --git a/www/roster/main.rb b/www/roster/main.rb
index 9a1afae..9085e79 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -19,12 +19,16 @@
require_relative 'models'
get '/' do
- @committers = ASF::Person.list
- @committees = ASF::Committee.list
- @members = ASF::Member.list.keys - ASF::Member.status.keys
- @groups = Group.list
- @podlings = ASF::Podlings.new.to_h.values
- _html :index
+ if env['REQUEST_URI'].end_with? '/'
+ @committers = ASF::Person.list
+ @committees = ASF::Committee.list
+ @members = ASF::Member.list.keys - ASF::Member.status.keys
+ @groups = Group.list
+ @podlings = ASF::Podlings.new.to_h.values
+ _html :index
+ else
+ redirect to('/')
+ end
end
get '/committer/' do
@@ -32,7 +36,7 @@
end
get '/committer' do
- call env.merge('PATH_INFO' => '/committer/')
+ redirect to('/committer/')
end
get '/committee/' do
@@ -42,8 +46,7 @@
end
get '/committee' do
- call env.merge('PATH_INFO' => '/committee/')
-end
+ redirect to('/committee/')
get '/committer/index.json' do
# bulk loading the mail information makes things go faster