From: radhika Date: Mon, 10 Aug 2015 18:32:50 +0000 (-0400) Subject: 6827: fix error in setting valid token. X-Git-Tag: 1.1.0~1410^2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/7c89127a0214c77578c09bac9ac24ce9e1c5e104 6827: fix error in setting valid token. --- diff --git a/services/arv-git-httpd/auth_handler.go b/services/arv-git-httpd/auth_handler.go index 89d942a517..1165354968 100644 --- a/services/arv-git-httpd/auth_handler.go +++ b/services/arv-git-httpd/auth_handler.go @@ -103,9 +103,9 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) { "filters": [][]string{{"name", "=", repoName}}, }, &reposFound); err != nil { statusCode, statusText = http.StatusInternalServerError, err.Error() - validApiToken = true return } + validApiToken = true if avail, ok := reposFound["items_available"].(float64); !ok { statusCode, statusText = http.StatusInternalServerError, "bad list response from API" return diff --git a/services/arv-git-httpd/server_test.go b/services/arv-git-httpd/server_test.go index 9d36921fe2..beabedd7e9 100644 --- a/services/arv-git-httpd/server_test.go +++ b/services/arv-git-httpd/server_test.go @@ -88,7 +88,7 @@ func (s *IntegrationSuite) TestInvalidToken(c *check.C) { func (s *IntegrationSuite) TestShortToken(c *check.C) { for _, repo := range []string{"active/foo.git", "active/foo/.git"} { err := s.runGit(c, "s3cr3t", "fetch", repo) - c.Assert(err, check.ErrorMatches, `.* Authentication failed.*`) + c.Assert(err, check.ErrorMatches, `.* 500 while accessing.*`) } }