Skip to content

Commit

Permalink
Show download link for files that exceed 4 megabytes
Browse files Browse the repository at this point in the history
In the past we showed the download link for files with
a size of less than 4 megabytes also to non authenticated users.
Now we show the link only to authenticated users no matter which
sizes the file has. A forgotten if statement led to the problem
that we didn't showed the download link to anyone anymore when
the file exceeds the 4 megabytes.

Fixes #10096
  • Loading branch information
krauselukas committed Aug 31, 2020
1 parent 96f8033 commit 517f5a4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/api/app/views/webui/package/_file.html.haml
Expand Up @@ -13,9 +13,8 @@
/ limit download for anonymous user to avoid getting killed by crawlers
- unless nobody
%td.text-center
- if file[:size].to_i < 4.megabytes
= link_to(file_url(project.name, package.name, file[:name], file[:srcmd5]), title: 'Download file') do
%i.fas.fa-download.text-secondary
= link_to(file_url(project.name, package.name, file[:name], file[:srcmd5]), title: 'Download file') do
%i.fas.fa-download.text-secondary
- if can_be_removed
= link_to('#', data: { toggle: 'modal', target: '#delete-file-modal', title: 'Delete file',
filename: file[:name], action: url_for(action: :remove_file, project: project, package: package, filename: file[:name]) }) do
Expand Down

0 comments on commit 517f5a4

Please sign in to comment.