From c922fb4b68e3d57bf5328b6825040f1871a48b66 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Wed, 6 Sep 2017 11:31:08 +0200 Subject: Respond with a bad request if artifact path is invalid --- lib/api/helpers.rb | 2 +- lib/api/job_artifacts.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 6fa1527461f..e646c63467a 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -222,7 +222,7 @@ module API def bad_request!(attribute) message = ["400 (Bad request)"] - message << "\"" + attribute.to_s + "\" not given" + message << "\"" + attribute.to_s + "\" not given" if attribute render_api_error!(message.join(' '), 400) end diff --git a/lib/api/job_artifacts.rb b/lib/api/job_artifacts.rb index e0c5449e65e..2a8fa7659bf 100644 --- a/lib/api/job_artifacts.rb +++ b/lib/api/job_artifacts.rb @@ -52,7 +52,7 @@ module API path = Gitlab::Ci::Build::Artifacts::Path .new(params[:artifact_path]) - not_found! unless path.valid? + bad_request! unless path.valid? send_artifacts_entry(build, path) end -- cgit v1.2.1