6827: fix error in setting valid token.
authorradhika <radhika@curoverse.com>
Mon, 10 Aug 2015 18:32:50 +0000 (14:32 -0400)
committerradhika <radhika@curoverse.com>
Mon, 10 Aug 2015 18:32:50 +0000 (14:32 -0400)
services/arv-git-httpd/auth_handler.go
services/arv-git-httpd/server_test.go

index 89d942a5172d58f8e44d73db530f303f8f6454a6..116535496893555e973dd503e02432df1f86f1d5 100644 (file)
@@ -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
index 9d36921fe2ad148664709cd9da5e16c9a44c931e..beabedd7e9220913d928680029a4c36b1441c7a9 100644 (file)
@@ -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.*`)
        }
 }