From 7c89127a0214c77578c09bac9ac24ce9e1c5e104 Mon Sep 17 00:00:00 2001 From: radhika Date: Mon, 10 Aug 2015 14:32:50 -0400 Subject: [PATCH] 6827: fix error in setting valid token. --- services/arv-git-httpd/auth_handler.go | 2 +- services/arv-git-httpd/server_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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.*`) } } -- 2.30.2