Commit 843548cc authored by Thomas Guyot-Sionnest's avatar Thomas Guyot-Sionnest

Fix HTTP push to public repos

When doing an HTTP push, git (as of v1.7.9) first do an info/refs
request, and only if this request requires authentication it asks the
user for its password and authenticates further requests.

The initial request normally clears without auth on public repos as it
doesn't update any ref. This patch forces every git-receive-pack
requests to provide authentication.
parent 23d180f5
...@@ -92,6 +92,9 @@ module Grack ...@@ -92,6 +92,9 @@ module Grack
return false unless can?(user, action, project) return false unless can?(user, action, project)
end end
# Never let git-receive-pack trough unauthenticated; it's
# harmless but git < 1.8 doesn't like it
return false if user.nil?
true true
else else
false false
......
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