hgweb mime-types for archives

Luc Heinrich luc at honk-honk.com
Wed Apr 4 05:22:09 CDT 2007


On 4 avr. 07, at 05:02, Matt Mackall wrote:

> It's probably specific to Safari.

In my case yes, but this could happen using any other user agent. And  
either way, gzipped tar archives should be served using the  
application/x-tar-gz content type [1], not application/x-tar. I'm not  
100% sure about bz2 compressed archives though, but they should  
probably be application/x-bzip-compressed-tar or at least application/ 
octet-stream, but definitely not x-tar.

diff -r d69bdc1091b8 mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py      Mon Apr 02 14:16:44 2007 -0500
+++ b/mercurial/hgweb/hgweb_mod.py      Wed Apr 04 12:21:29 2007 +0200
@@ -601,8 +601,8 @@ class hgweb(object):
                       diff=diff)
      archive_specs = {
-        'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', None),
-        'gz': ('application/x-tar', 'tgz', '.tar.gz', None),
+        'bz2': ('application/x-bzip-compressed-tar', 'tbz2',  
'.tar.bz2', None),
+        'gz': ('application/x-tar-gz', 'tgz', '.tar.gz', None),
          'zip': ('application/zip', 'zip', '.zip', None),
          }


[1] http://www.mimetype.org/

-- 
Luc Heinrich




More information about the Mercurial mailing list