Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-15 16:40:53 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-15 16:40:53 +0300
commit548169cfb57b27cca911d947e2aa6f4f7e6df004 (patch)
tree94e9d3793cd8738ca7428521518f7dc4f0a539e0 /app/controllers/projects/git_http_client_controller.rb
parent551787ac5c12a502b46c819939b2fa11684a799c (diff)
Fix most of specs
Diffstat (limited to 'app/controllers/projects/git_http_client_controller.rb')
-rw-r--r--app/controllers/projects/git_http_client_controller.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/projects/git_http_client_controller.rb b/app/controllers/projects/git_http_client_controller.rb
index aabb5b0fe01..c2a298fe37f 100644
--- a/app/controllers/projects/git_http_client_controller.rb
+++ b/app/controllers/projects/git_http_client_controller.rb
@@ -23,10 +23,12 @@ class Projects::GitHttpClientController < Projects::ApplicationController
login, password = user_name_and_password(request)
auth_result = Gitlab::Auth.find_for_git_client(login, password, project: project, ip: request.ip)
- if auth_result.type == :ci && download_request?
- @ci = true
+ if auth_result.type == :ci && !download_request?
+ # Not allowed
+ auth_result = Gitlab::Auth::Result.new
elsif auth_result.type == :oauth && !download_request?
# Not allowed
+ auth_result = Gitlab::Auth::Result.new
elsif auth_result.type == :missing_personal_token
render_missing_personal_token
return # Render above denied access, nothing left to do
@@ -35,6 +37,7 @@ class Projects::GitHttpClientController < Projects::ApplicationController
end
@capabilities = auth_result.capabilities || []
+ @ci = auth_result.type == :ci
if auth_result.succeeded?
return # Allow access