Commit 87de16ef authored by Kirill Smelkov's avatar Kirill Smelkov

X switch to /archive/... for quering auth backend

parent 2960ec22
...@@ -167,11 +167,15 @@ func askAuthBackend(u *upstream, project string) AuthReply { ...@@ -167,11 +167,15 @@ func askAuthBackend(u *upstream, project string) AuthReply {
RawReply: httptest.NewRecorder(), RawReply: httptest.NewRecorder(),
} }
// Request to auth backend to verify whether download is possible via // Request to auth backend to verify whether download is possible.
// asking as `git fetch` would do. // - first option is via asking as `git fetch` would do, but on Rails
// side this supports only basic auth, not private token.
// - that's why we auth backend to authenticate as if it is request to
// get repo archive XXX
// XXX private_token not propagated, etc ... // XXX private_token not propagated, etc ...
// XXX PRIVATE-TOKEN (if header) // XXX PRIVATE-TOKEN (in header)
reqDownloadAccess, err := http.NewRequest("GET", project+".git/info/refs?service=git-upload-pack", nil) //reqDownloadAccess, err := http.NewRequest("GET", project+".git/info/refs?service=git-upload-pack", nil)
reqDownloadAccess, err := http.NewRequest("GET", project+"/repository/archive.zip", nil)
if err != nil { if err != nil {
fail500(authReply.RawReply, "GET git-upload-pack", err) fail500(authReply.RawReply, "GET git-upload-pack", err)
return authReply return authReply
......
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