From 18d51a404ada15f07b94c4cc3d6d678cadcf607b Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 22 May 2015 13:11:18 -0400 Subject: [PATCH] LP#1449709: Always get a real hostname for the cache key EGCatLoader overwrites $ctx->{hostname} when serving the staff client version of TT-generated content. This is bad for us because we use that as part of the TT Processor cache key. Instead, we'll just always ask Apache, via $r. Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index f2f6f40033..da18d7e56d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -86,7 +86,7 @@ sub handler_guts { my $text_handler = set_text_handler($ctx, $r); my $processor_key = $as_xml ? 'xml:' : 'text:'; # separate by XML strictness - $processor_key .= $ctx->{hostname}.':'; # ... and vhost + $processor_key .= $r->hostname.':'; # ... and vhost $processor_key .= $r->dir_config('OILSWebContextLoader').':'; # ... and context loader $processor_key .= $ctx->{locale}; # ... and locale # NOTE: context loader and vhost together imply template path and debug template values @@ -297,8 +297,8 @@ sub find_template { my $ext = $r->dir_config('OILSWebDefaultTemplateExtension'); my $at_index = $r->dir_config('OILSWebStopAtIndex'); - $vhost_path_cache{$ctx->{hostname}} ||= {}; - my $path_cache = $vhost_path_cache{$ctx->{hostname}}; + $vhost_path_cache{$r->hostname} ||= {}; + my $path_cache = $vhost_path_cache{$r->hostname}; my @parts = split('/', $path); my $localpath = $path; -- 2.43.2