Răsfoiți Sursa

better caching & logging

George Baugh 5 luni în urmă
părinte
comite
1c3d57638e
2 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 2 0
      lib/TCMS.pm
  2. 1 2
      lib/Trog/Routes/HTML.pm

+ 2 - 0
lib/TCMS.pm

@@ -87,6 +87,8 @@ sub build_routes {
                 $active_user     = Trog::Auth::session2user( $cookies->{tcmslogin}->value );
                 $Trog::Log::user = $active_user if $active_user;
             }
+            # Make sure TPSGI can log the user
+            $tpsgi->{user} = $active_user;
 
             # Enrich the query with tcms specific foo
             $query->{user_acls} = [];

+ 1 - 2
lib/Trog/Routes/HTML.pm

@@ -1572,12 +1572,11 @@ sub metrics ($query) {
     );
 }
 
-# XXX we should never ever have to get here, let tpsgi handle it instead
 # basically a file rewrite rule for themes
 sub icon ($query) {
     my $path = $query->{route};
     my $tpath = Trog::Themes::themed("img/icon/$path");
-    return $query->{tpsgi}->serve( $tpath, $tpath, $query->{start}, $query->{streaming}, $query->{ranges}, $query->{last_fetched}, $query->{deflate}  );
+    return $query->{tpsgi}->serve( $path, $tpath, $query->{start}, $query->{streaming}, $query->{ranges}, $query->{last_fetched}, $query->{deflate}  );
 }
 
 sub totp_qr ($query) {