summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3f55e41)
raw | patch | inline | side by side (parent: 3f55e41)
author | Mark A Rada <marada@uwaterloo.ca> | |
Thu, 6 Aug 2009 14:25:39 +0000 (10:25 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 6 Aug 2009 21:03:25 +0000 (14:03 -0700) |
Allow Gitweb administrators to set a 'disabled' key in the
%known_snapshot_formats hash to disable a specific snapshot format.
All formats are enabled by default to maintain backwards compatibility.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
%known_snapshot_formats hash to disable a specific snapshot format.
All formats are enabled by default to maintain backwards compatibility.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 37120a3e606a2e3e192cf59e2e69d29efd774d33..a0cdf316660ce3e8f3f84798fda0a80358ff11b1 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
# 'suffix' => filename suffix,
# 'format' => --format for git-archive,
# 'compressor' => [compressor command and arguments]
- # (array reference, optional)}
+ # (array reference, optional)
+ # 'disabled' => boolean (optional)}
#
'tgz' => {
'display' => 'tar.gz',
exists $known_snapshot_format_aliases{$_} ?
$known_snapshot_format_aliases{$_} : $_} @fmts;
@fmts = grep {
- exists $known_snapshot_formats{$_} } @fmts;
+ exists $known_snapshot_formats{$_} &&
+ !$known_snapshot_formats{$_}{'disabled'}} @fmts;
}
our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
die_error(400, "Unknown snapshot format");
} elsif (!grep($_ eq $format, @snapshot_fmts)) {
die_error(403, "Unsupported snapshot format");
+ } elsif ($known_snapshot_formats{$format}{'disabled'}) {
+ die_error(403, "Snapshot format not allowed");
}
if (!defined $hash) {