[LON-CAPA-cvs] cvs: loncom / lontrans.pm

raeburn raeburn at source.lon-capa.org
Tue May 8 11:31:22 EDT 2018


raeburn		Tue May  8 15:31:22 2018 EDT

  Modified files:              
    /loncom	lontrans.pm 
  Log:
  - Use internal_redirect to redirect to resource pointed to by a tiny URL, except 
    when authenticated via LTI.
  
  
Index: loncom/lontrans.pm
diff -u loncom/lontrans.pm:1.22 loncom/lontrans.pm:1.23
--- loncom/lontrans.pm:1.22	Sat Apr 21 20:34:44 2018
+++ loncom/lontrans.pm	Tue May  8 15:31:22 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # URL translation for User Files
 #
-# $Id: lontrans.pm,v 1.22 2018/04/21 20:34:44 raeburn Exp $
+# $Id: lontrans.pm,v 1.23 2018/05/08 15:31:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -91,7 +91,10 @@
                                         }
                                     }
                                     my $host = $r->headers_in->get('Host');
-                                    if ($host) {
+                                    if ($r->is_initial_req() || !$host) {
+                                        $r->internal_redirect($realuri);
+                                        return OK;
+                                    } else {
                                         my $protocol = 'http';
                                         if ($r->get_server_port == 443) {
                                             $protocol = 'https';




More information about the LON-CAPA-cvs mailing list