X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3e271eb8bc19f67465a33a69dc66a27021301fae..982f7db5b67194ddb3b3dd1fae594784f58b35b8:/services/arv-git-httpd/auth_handler.go diff --git a/services/arv-git-httpd/auth_handler.go b/services/arv-git-httpd/auth_handler.go index ef16acbd6f..6313d50d68 100644 --- a/services/arv-git-httpd/auth_handler.go +++ b/services/arv-git-httpd/auth_handler.go @@ -52,7 +52,7 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) { w.WriteHeader(statusCode) w.Write([]byte(statusText)) } - log.Println(quoteStrings(r.RemoteAddr, username, password, wroteStatus, statusText, repoName, r.URL.Path)...) + log.Println(quoteStrings(r.RemoteAddr, username, password, wroteStatus, statusText, repoName, r.Method, r.URL.Path)...) }() // HTTP request username is logged, but unused. Password is an @@ -60,7 +60,7 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) { username, password, ok := BasicAuth(r) if !ok || username == "" || password == "" { statusCode, statusText = http.StatusUnauthorized, "no credentials provided" - w.Header().Add("WWW-Authenticate", "basic") + w.Header().Add("WWW-Authenticate", "Basic realm=\"git\"") return } @@ -87,7 +87,7 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) { arv.ApiToken = password reposFound := arvadosclient.Dict{} if err := arv.List("repositories", arvadosclient.Dict{ - "filters": [][]string{[]string{"name", "=", repoName}}, + "filters": [][]string{{"name", "=", repoName}}, }, &reposFound); err != nil { statusCode, statusText = http.StatusInternalServerError, err.Error() return