[Bps-public-commit] smokingit branch, master, updated. df9903fce63af5409cacc9ea1fed813e7839bbaf

Thomas Sibley trs at bestpractical.com
Fri Jul 29 11:36:31 EDT 2011


The branch, master has been updated
       via  df9903fce63af5409cacc9ea1fed813e7839bbaf (commit)
      from  747450cf761bea7be7d971a630b66937ccd815ab (commit)

Summary of changes:
 lib/Smokingit/Dispatcher.pm |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit df9903fce63af5409cacc9ea1fed813e7839bbaf
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Jul 29 11:36:10 2011 -0400

    Make sure projects are always accessed with a trailing slash
    
    This ensures relative links will always work correctly.

diff --git a/lib/Smokingit/Dispatcher.pm b/lib/Smokingit/Dispatcher.pm
index 64c8d8e..a5c80d7 100644
--- a/lib/Smokingit/Dispatcher.pm
+++ b/lib/Smokingit/Dispatcher.pm
@@ -23,6 +23,11 @@ under '/project/*' => [
 
     on '' => run {
         my $project = get('project');
+
+        unless (Jifty->web->request->uri =~ m{/$}) {
+            redirect '/project/'.$project->name.'/';
+        }
+
         if ($project->configurations->count) {
             show '/project';
         } else {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list