--- loncom/lontrans.pm 2016/08/16 20:17:54 1.16 +++ loncom/lontrans.pm 2020/02/29 16:05:21 1.26 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for User Files # -# $Id: lontrans.pm,v 1.16 2016/08/16 20:17:54 raeburn Exp $ +# $Id: lontrans.pm,v 1.26 2020/02/29 16:05:21 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,13 +30,13 @@ package Apache::lontrans; use strict; use Apache::Constants qw(:common :remotehost REDIRECT); -use Apache::lonnet(); +use Apache::lonnet; use Apache::File(); use LONCAPA qw(:DEFAULT :match); sub handler { my $r = shift; - # FIXME line remove when mod_perl fixes BUG#4948 + # FIXME line remove when mod_perl fixes BUG#4948 $r->notes->set('error-notes' => ''); if ($r->uri=~m{^/raw/}) { my $host = $r->headers_in->get('Host'); @@ -66,9 +66,12 @@ sub handler { '/userfiles/'.(join('/',@ufile))); } return OK; - } else { - return DECLINED; + } elsif ($r->uri =~ m{^\Q/adm/wrapper/ext/https:/\E[^/]}) { + my $uri = $r->uri; + $uri =~ s{^(\Q/adm/wrapper/ext/https:/\E)}{$1/}; + $r->uri($uri); } + return DECLINED; } sub redirect_raw { @@ -98,16 +101,16 @@ sub redirect_raw { my $remintdom = &Apache::lonnet::internet_dom($remprimary); if (ref($replication->{'certreq'}) eq 'ARRAY') { if (grep(/^\Q$remintdom\E$/,@{$replication->{'certreq'}})) { - $redirect = 1; - } else { $redirect = 0; + } else { + $redirect = 1; } } if (ref($replication->{'nocertreq'}) eq 'ARRAY') { if (grep(/^\Q$remintdom\E$/,@{$replication->{'nocertreq'}})) { - $redirect = 0; - } else { $redirect = 1; + } else { + $redirect = 0; } } } @@ -117,15 +120,9 @@ sub redirect_raw { last; } } - return $redirect; + return $redirect; } 1; __END__ - - - - - -