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

Re: [RFC/PATCH] gitweb: Try to sanitize mimetype for 'blob_plain' view

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 20, 2007, 10:58 UTC
Message-ID
<200711201158.06029.jnareb@gmail.com>
In-Reply-To
<4BAE81C8-EFF3-473D-B243-B7D0F66F131B@wincent.com>
Wincent Colaiuta wrote:
Show 6 quoted lines
> So yes, this is discarding information -- in a sense it is actually  
> removing *correct* configuration from the server side to work around  
> undesired behaviour on the client side -- but it gave the behaviour I  
> wanted. So I think this patch is actually a good idea, because the  
> behaviour (the user experience) is more important than adhering to a  
> standard just because its a standard.

Modifying gitweb to work around not configured web browser and mime.types not written for gitweb like in this RFC patch is one way of solving this. Is it good way? That is why it is an RFC... well that and details of sanitization.

Another would be to use mime.types crafted specially for gitweb, and use it for $mimetypes_file (gitweb falls back to /etc/mime.types if it is not defined or not present). This might be better solution.

QUESTION: Currently gitweb checks if $mimetypes_file is relative path 
(using nonportable m!^/! instead of File::Spec::file_name_is_absolute),
and if it is then it is used as relative to project. Does anyone use 
this feature to provide per-project mimetypes? Would perhaps using 
relative path as-is (i.e. relative to gitweb script) be better 
solution, and checking for gitweb.mimetypes repo configuration variable 
for per-repo relative to project if relative?
-- 
Jakub Narebski
Poland
Previous: Junio C Hamano
Message 3 of 3 in “gitweb: Try to sanitize mimetype for 'blob_plain' view”
  1. gitweb: Try to sanitize mimetype for 'blob_plain' viewJakub Narebski, Nov 19, 2007
  2. Junio C HamanoNov 20, 2007
  3. Jakub NarebskiNov 20, 2007

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.