Re: [PATCH] gitweb: use correct mime type even if filename has multiple dots.

From: Martin Waitz <tali@admingilde.org>
Date: 2006-09-17 17:51:57
hoi :)

On Sat, Sep 16, 2006 at 11:44:52PM +0200, Jakub Narebski wrote:
> Martin Waitz wrote:
> 
> > Match the last part of the filename agains the extention from the
> > mime database instead of insisting that it starts at the first dot.
> [...]
> > -     $filename =~ /\.(.*?)$/;
> > -     return $mimemap{$1};
> 
> Actually, that is non-greedy match, so the above code insist that 
> extension starts at the _last_ dot.

hmm, but it didn't work for me.
I had filenames like "man/program.8.html" which got served as
"text/html" with the old code.

Besides, the new code would cope with extentions that contain a
dot itself.

Looking at /etc/mime.types, it only contains pcf.Z but perhaps
it should also contain tar.gz or similiar.
> 
> -- 
> Jakub Narebski
> Warsaw, Poland
> ShadeHawk on #git
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Martin Waitz

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Sun Sep 17 17:53:18 2006

This archive was generated by hypermail 2.1.8 : 2006-09-17 17:54:04 EST