hgweb mime-types for archives

Tim Post tim.post at netkinetics.net
Wed Apr 4 05:37:11 CDT 2007


On Wed, 2007-04-04 at 12:22 +0200, Luc Heinrich wrote:
> On 4 avr. 07, at 05:02, Matt Mackall wrote:
> 
> > It's probably specific to Safari.

If I'm not mistaken, it most likely effects (some versions) of Konqueror
too. I don't have time to check, but I'm almost 100% certain that it
does.

> 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),
>           }

Thanks, going to apply this now because I'll soon be confronted with the
same issue / gripe when I make my repos public. 

Best,
--Tim





More information about the Mercurial mailing list