summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api')
-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