]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/DoIndex.pm
Packages::Dispatcher: Send 304 header if possible
[deb/packages.git] / lib / Packages / DoIndex.pm
index a0cae2baf2f435cff7fa59f1f698d1d2ee19894c..e1c5b6d3667ef650ace6d0ead1b2231684128259 100644 (file)
@@ -39,6 +39,9 @@ sub send_file {
                              "@{$opts->{suite}}" ) );
     }
 
+    if ($opts->{format} eq 'txt.gz') {
+       $opts->{po_lang} = 'en';
+    }
     my $wwwdir = "$TOPDIR/www";
     my $path = "";
     $path .= "source/" if $opts->{source};
@@ -46,12 +49,7 @@ sub send_file {
     $path .= "$opts->{archive}[0]/" if @{$opts->{archive}} == 1;
     $path .= "$opts->{subsection}[0]/" if @{$opts->{subsection}};
     $path .= "$opts->{priority}[0]/" if @{$opts->{priority}};
-
-    #FIXME: ugly hack
-    if ($opts->{lang} ne 'en' and !-f "$wwwdir/$path$file.$opts->{lang}.$opts->{format}") {
-       $opts->{lang} = 'en';
-    }
-    $path .= "$file.$opts->{lang}.$opts->{format}";
+    $path .= "$file.$opts->{po_lang}.$opts->{format}";
 
     unless (@Packages::CGI::fatal_errors) {
        my $buffer;