Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-04 15:07:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-04 15:07:52 +0300
commitc6c7437861bff9572747674095c4dfbdfbea4988 (patch)
tree237d1ed922193f19ae326923457344c082003788 /app/controllers/projects/releases_controller.rb
parentd80f3cd75e700b6e62910865bfd36734644ffa89 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects/releases_controller.rb')
-rw-r--r--app/controllers/projects/releases_controller.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/controllers/projects/releases_controller.rb b/app/controllers/projects/releases_controller.rb
index 7ad841d645d..d5f93c4baf6 100644
--- a/app/controllers/projects/releases_controller.rb
+++ b/app/controllers/projects/releases_controller.rb
@@ -3,7 +3,7 @@
class Projects::ReleasesController < Projects::ApplicationController
# Authorize
before_action :require_non_empty_project, except: [:index]
- before_action :release, only: %i[edit show update]
+ before_action :release, only: %i[edit show update downloads]
before_action :authorize_read_release!
before_action do
push_frontend_feature_flag(:release_issue_summary, project)
@@ -40,6 +40,10 @@ class Projects::ReleasesController < Projects::ApplicationController
end
end
+ def downloads
+ redirect_to link.url
+ end
+
protected
def releases
@@ -69,6 +73,14 @@ class Projects::ReleasesController < Projects::ApplicationController
@release ||= project.releases.find_by_tag!(sanitized_tag_name)
end
+ def link
+ release.links.find_by_filepath!(sanitized_filepath)
+ end
+
+ def sanitized_filepath
+ CGI.unescape(params[:filepath])
+ end
+
def sanitized_tag_name
CGI.unescape(params[:tag])
end