Commit 41c87b9a authored by Patricio Cano's avatar Patricio Cano

Return :forbidden if HTTP protocol access is not allowed

parent ace309d7
...@@ -19,6 +19,8 @@ class Projects::GitHttpController < Projects::ApplicationController ...@@ -19,6 +19,8 @@ class Projects::GitHttpController < Projects::ApplicationController
render_ok render_ok
elsif receive_pack? && receive_pack_allowed? elsif receive_pack? && receive_pack_allowed?
render_ok render_ok
elsif !upload_pack_allowed?
render_not_allowed
else else
render_not_found render_not_found
end end
...@@ -154,6 +156,10 @@ class Projects::GitHttpController < Projects::ApplicationController ...@@ -154,6 +156,10 @@ class Projects::GitHttpController < Projects::ApplicationController
render plain: 'Not Found', status: :not_found render plain: 'Not Found', status: :not_found
end end
def render_not_allowed
render json: access.to_json, status: :forbidden
end
def ci? def ci?
@ci.present? @ci.present?
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment