From 346618da6d0527335b67d17dea78f7d6c55fb129 Mon Sep 17 00:00:00 2001 From: Khai Do Date: Fri, 9 May 2014 12:24:39 -0700 Subject: [PATCH] Configure direct download of files to browser Gerrit by default wraps all file downloads in zipped archive. This can be overridden using the mimetype setting[1]. This change allows downloading of xml, yaml, rst, html, and txt files without being wrapped inside of a zipped archives. [1] https://review.openstack.org/Documentation/config-gerrit.html Change-Id: I47563de12a2bc8c8a3755fa777abf029cc4e0c28 --- templates/gerrit.config.erb | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/templates/gerrit.config.erb b/templates/gerrit.config.erb index dc3abd7..0fca872 100644 --- a/templates/gerrit.config.erb +++ b/templates/gerrit.config.erb @@ -81,20 +81,20 @@ email = <%= email %> <% commentlinks.each do |commentlink| -%> [commentlink "<%= commentlink['name'] %>"] - match = "<%= commentlink['match'] %>" + match = "<%= commentlink['match'] %>" <% if commentlink['link'] != "" -%> - link = "<%= commentlink['link'] %>" + link = "<%= commentlink['link'] %>" <% end -%> <% if commentlink['html'] != "" -%> - html = "<%= commentlink['html'] %>" + html = "<%= commentlink['html'] %>" <% end -%> <% end -%> [theme] - backgroundColor = ffffff - topMenuColor = ffffff - textColor = 264d69 - trimColor = eef3f5 - selectionColor = d1e6ea + backgroundColor = ffffff + topMenuColor = ffffff + textColor = 264d69 + trimColor = eef3f5 + selectionColor = d1e6ea changeTableOutdatedColor = f5cccc tableOddRowColor = ffffff tableEvenRowColor = f5f5ff @@ -122,4 +122,14 @@ type = <%= secondary_index_type %> <% end -%> [mimetype "image/*"] -safe = true + safe = true +[mimetype "application/yaml"] + safe = true +[mimetype "application/xml"] + safe = true +[mimetype "application/rst"] + safe = true +[mimetype "application/txt"] + safe = true +[mimetype "application/html"] + safe = true