From e8b03baf6b67a14c0db6dbf3a1abaa4a6a173213 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 18 Aug 2016 15:31:20 +0800 Subject: Use path rather than URL because it should work for http 302: Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_14035941 --- app/controllers/projects/artifacts_controller.rb | 4 ++-- app/helpers/gitlab_routing_helper.rb | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb index 8261a73c642..16ab7ec409d 100644 --- a/app/controllers/projects/artifacts_controller.rb +++ b/app/controllers/projects/artifacts_controller.rb @@ -35,10 +35,10 @@ class Projects::ArtifactsController < Projects::ApplicationController end def latest_succeeded - target_url = artifacts_action_url(params[:path], project, build) + target_path = artifacts_action_path(params[:path], project, build) if target_url - redirect_to(target_url) + redirect_to(target_path) else render_404 end diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb index bc4d976ae68..cd526f17b99 100644 --- a/app/helpers/gitlab_routing_helper.rb +++ b/app/helpers/gitlab_routing_helper.rb @@ -152,16 +152,16 @@ module GitlabRoutingHelper # Artifacts - def artifacts_action_url(path, project, build) + def artifacts_action_path(path, project, build) args = [project.namespace, project, build] case path when 'download' - download_namespace_project_build_artifacts_url(*args) + download_namespace_project_build_artifacts_path(*args) when 'browse' - browse_namespace_project_build_artifacts_url(*args) + browse_namespace_project_build_artifacts_path(*args) when 'file' - file_namespace_project_build_artifacts_url(*args) + file_namespace_project_build_artifacts_path(*args) end end end -- cgit v1.2.1