[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r9249 - /man-cgi/man.cgi



Author: jfs
Date: Tue Jul  3 23:26:03 2012
New Revision: 9249

URL: http://svn.debian.org/wsvn/?sc=1&rev=9249
Log:

Apply a patch provided by anomie@users.sourceforge.net. This
fixes the code used to download a gzip'd tar archive of the manpages.

The changes makes it use the -L flag to cpio so the archive contains the actual
manpages instead of broken symlinks.

Also, the content is served with Content-Type application/x-gzip and no
Content-Encoding so the visitor's browser doesn't uncompress the file when
saving.   


Modified:
    man-cgi/man.cgi

Modified: man-cgi/man.cgi
URL: http://svn.debian.org/wsvn/man-cgi/man.cgi?rev=9249&op=diff
==============================================================================
--- man-cgi/man.cgi (original)
+++ man-cgi/man.cgi Tue Jul  3 23:26:03 2012
@@ -383,10 +383,9 @@
     $filename = &encode_url($filename);
     $filename .= '.tar.gz';
 
-    print qq{Content-type: application/x-tar\n} .
-	qq{Content-encoding: x-gzip\n} .
-	qq{Content-disposition: inline; filename="$filename"\n} .
-	"\n";
+    print qq{Content-type: application/x-gzip\n} .
+        qq{Content-disposition: attachment; filename="$filename"\n} .
+        "\n";
 
     local(@m); 
     local($m) = $manPath{"$manpath"};
@@ -399,10 +398,10 @@
     };
 
     $m = join(" ", @m);
-    #warn "find $m -print | cpio -o -H tar 2>/dev/null | gzip -cqf";
+    #warn "find $m -print | cpio -o -L -H tar 2>/dev/null | gzip -cqf";
 
     sleep 1;
-    system("find $m -print | cpio -o -H tar 2>/dev/null | gzip -cqf");
+    system("find $m -print | cpio -o -L -H tar 2>/dev/null | gzip -cqf");
     exit(0);
 }
 


Reply to: