diff options
Diffstat (limited to 'ui-snapshot.c')
-rw-r--r-- | ui-snapshot.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c index 92c3277..fa3ceaf 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c | |||
@@ -86,6 +86,7 @@ static int write_tar_xz_archive(const char *hex, const char *prefix) | |||
86 | } | 86 | } |
87 | 87 | ||
88 | const struct cgit_snapshot_format cgit_snapshot_formats[] = { | 88 | const struct cgit_snapshot_format cgit_snapshot_formats[] = { |
89 | /* .tar must remain the 0 index */ | ||
89 | { ".tar", "application/x-tar", write_tar_archive }, | 90 | { ".tar", "application/x-tar", write_tar_archive }, |
90 | { ".tar.gz", "application/x-gzip", write_tar_gzip_archive }, | 91 | { ".tar.gz", "application/x-gzip", write_tar_gzip_archive }, |
91 | { ".tar.bz2", "application/x-bzip2", write_tar_bzip2_archive }, | 92 | { ".tar.bz2", "application/x-bzip2", write_tar_bzip2_archive }, |
@@ -268,7 +269,7 @@ void cgit_print_snapshot(const char *head, const char *hex, | |||
268 | } | 269 | } |
269 | 270 | ||
270 | f = get_format(filename); | 271 | f = get_format(filename); |
271 | if (!f || !(ctx.repo->snapshots & cgit_snapshot_format_bit(f))) { | 272 | if (!f || (!sig_filename && !(ctx.repo->snapshots & cgit_snapshot_format_bit(f)))) { |
272 | cgit_print_error_page(400, "Bad request", | 273 | cgit_print_error_page(400, "Bad request", |
273 | "Unsupported snapshot format: %s", filename); | 274 | "Unsupported snapshot format: %s", filename); |
274 | return; | 275 | return; |