Skip to content

Commit 396d205

Browse files
committed
Merge branch 'mc/fix-artifact-before-validation' into 'master'
Disable artifact validation for download action See merge request gitlab-org/gitlab-ce!22300
2 parents 99127e6 + 22d1ec6 commit 396d205

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/controllers/projects/artifacts_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
1010
before_action :authorize_update_build!, only: [:keep]
1111
before_action :extract_ref_name_and_path
1212
before_action :set_request_format, only: [:file]
13-
before_action :validate_artifacts!
13+
before_action :validate_artifacts!, except: [:download]
1414
before_action :entry, only: [:file]
1515

1616
def download
@@ -102,7 +102,7 @@ def build_from_ref
102102
# rubocop: enable CodeReuse/ActiveRecord
103103

104104
def artifacts_file
105-
@artifacts_file ||= build.artifacts_file_for_type(params[:file_type] || :archive)
105+
@artifacts_file ||= build&.artifacts_file_for_type(params[:file_type] || :archive)
106106
end
107107

108108
def entry

app/controllers/projects/build_artifacts_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ class Projects::BuildArtifactsController < Projects::ApplicationController
66

77
before_action :authorize_read_build!
88
before_action :extract_ref_name_and_path
9-
before_action :validate_artifacts!
9+
before_action :validate_artifacts!, except: [:download]
1010

1111
def download
12-
redirect_to download_project_job_artifacts_path(project, job)
12+
redirect_to download_project_job_artifacts_path(project, job, params: request.query_parameters)
1313
end
1414

1515
def browse

0 commit comments

Comments
 (0)