From 8df07b23256c3e7f8fabb854c70a3f143f20924c Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 12 Dec 2013 11:48:39 -0500 Subject: [PATCH] web staff : egweb stop-at-index supports /-ended paths Signed-off-by: Bill Erickson --- Open-ILS/examples/apache/eg_vhost.conf.in | 5 ----- Open-ILS/examples/apache_24/eg_vhost.conf.in | 5 ----- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 6 +++++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Open-ILS/examples/apache/eg_vhost.conf.in b/Open-ILS/examples/apache/eg_vhost.conf.in index 5305d0b7cf..a99d9ce662 100644 --- a/Open-ILS/examples/apache/eg_vhost.conf.in +++ b/Open-ILS/examples/apache/eg_vhost.conf.in @@ -791,11 +791,6 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT] Options -MultiViews PerlSetVar OILSWebStopAtIndex "true" - # map /eg/staff to /eg/staff/index - RewriteEngine On - RewriteCond %{PATH_INFO} =/staff/ - RewriteRule (.*) /eg/staff/index [L,DPI] - Header append Cache-Control "public" diff --git a/Open-ILS/examples/apache_24/eg_vhost.conf.in b/Open-ILS/examples/apache_24/eg_vhost.conf.in index dfdeb550d0..c94ef545a7 100644 --- a/Open-ILS/examples/apache_24/eg_vhost.conf.in +++ b/Open-ILS/examples/apache_24/eg_vhost.conf.in @@ -803,11 +803,6 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT] Options -MultiViews PerlSetVar OILSWebStopAtIndex "true" - # map /eg/staff to /eg/staff/index - RewriteEngine On - RewriteCond %{PATH_INFO} =/staff/ - RewriteRule (.*) /eg/staff/index [L,DPI] - Header append Cache-Control "public" diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 4d00a3f293..c952a0bd37 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -264,7 +264,11 @@ sub find_template { # file in the same directory instead. for my $tpath (@{$ctx->{template_paths}}) { # replace the final path component with 'index' - $localpath =~ s|/[^/]+$|/index|; + if ($localpath =~ m|/$|) { + $localpath .= 'index'; + } else { + $localpath =~ s|/[^/]+$|/index|; + } my $fpath = "$tpath/$localpath.$ext"; $r->log->debug("egweb: looking at possible template $fpath"); if (-r $fpath) { -- 2.11.0