summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-13 14:47:59 +0100
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-13 14:47:59 +0100
commit54ab9bb6df3a2cd9f9384aebae07e0b18acee10b (patch)
tree89c102b6d362ca3db8636a3707fc9772f9b4b803 /lib
parentfd01f3aacda1e7e1966489e7d9a31f89745cd509 (diff)
downloadgitlab-ce-54ab9bb6df3a2cd9f9384aebae07e0b18acee10b.tar.gz
API: return status code 400 if filepath of raw file blob not given
Diffstat (limited to 'lib')
-rw-r--r--lib/api/projects.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 02f10b60cb7..24761cd5b55 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -451,6 +451,8 @@ module Gitlab
get ":id/repository/commits/:sha/blob" do
authorize! :download_code, user_project
+ error!("Filepath must be specified", 400) if !params.has_key? :filepath
+
ref = params[:sha]
commit = user_project.repository.commit ref