git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: safely output binary files for 'blob_plain' action

From
Junio C Hamano <junkio@cox.net>
Date
Jun 17, 2006, 22:30 UTC
Message-ID
<7vejxn76u4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060617220106.GJ2609@pasky.or.cz>
Petr Baudis <pasky@suse.cz> writes:
Show 20 quoted lines
>> In other words, something like this:
>> 
>>   (in torvalds/linux-2.6.git/config)
>> 
>> 	[gitweb]
>>         description = "Linus's kernel tree"
>>         ; defaultblobcharset = "latin1"
>>         blobmimemapfile = "mime-map"
>> 
>>   (in torvalds/linux-2.6.git/mime-map, first match decides)
>> 
>> 	fs/nls/nls_euc-jp.c	text/plain; charset=euc_jp
>>         *.c	text/plain; charset=utf-8
>>         *.h     text/plain; charset=utf-8
>
> You could as well just support the mime.types format and load
> /etc/mime.types for this kind of mapping (see below for a patch). The
> advantage is that this pretty much covers all the MIME types you will
> need, the disadvantage is that it's less flexible and the charset part
> wouldn't probably fit in nicely.

Ah, I thought Jakub's patch was already taking care of mime.types but apparently that was not the case. As you say, using /etc/mime.types for this is obviously a good point to start.

> We could obviously do both. :-)

The point of my example was about charset part; comparing the suffix part only is not good enough for .po files, so we should obviously do both.

Previous: Petr Baudis
Message 6 of 6 in “gitweb: safely output binary files for 'blob_plain' action”
  1. gitweb: safely output binary files for 'blob_plain' actionJakub Narebski, Jun 17, 2006
  2. Petr BaudisJun 17, 2006
  3. gitweb: text files for 'blob_plain' action without charset by defaultJakub Narebski, Jun 17, 2006
  4. Junio C HamanoJun 17, 2006
  5. Petr BaudisJun 17, 2006
  6. Junio C HamanoJun 17, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.