whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit bc789d3: redirect if slash isn't present
Date Fri, 04 Mar 2016 18:01:02 GMT
Commit bc789d3a00b113ed560812d63c0119d08cf7c3fa:
    redirect if slash isn't present


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@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

Mime
View raw message