Return :forbidden if HTTP protocol access is not allowed
This commit is contained in:
parent
ace309d775
commit
41c87b9a23
|
|
@ -19,6 +19,8 @@ class Projects::GitHttpController < Projects::ApplicationController
|
|||
render_ok
|
||||
elsif receive_pack? && receive_pack_allowed?
|
||||
render_ok
|
||||
elsif !upload_pack_allowed?
|
||||
render_not_allowed
|
||||
else
|
||||
render_not_found
|
||||
end
|
||||
|
|
@ -154,6 +156,10 @@ class Projects::GitHttpController < Projects::ApplicationController
|
|||
render plain: 'Not Found', status: :not_found
|
||||
end
|
||||
|
||||
def render_not_allowed
|
||||
render json: access.to_json, status: :forbidden
|
||||
end
|
||||
|
||||
def ci?
|
||||
@ci.present?
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue