//
// SPDX-License-Identifier: AGPL-3.0
-package main
+package githttpd
import (
+ "context"
"net/http"
"net/http/httptest"
"net/url"
URL: u,
RemoteAddr: "[::1]:12345",
}
- h := newGitHandler(s.cluster)
+ h := newGitHandler(context.Background(), s.cluster)
h.(*gitHandler).Path = "/bin/sh"
h.(*gitHandler).Args = []string{"-c", "printf 'Content-Type: text/plain\r\n\r\n'; env"}
URL: u,
RemoteAddr: "test.bad.address.missing.port",
}
- h := newGitHandler(s.cluster)
+ h := newGitHandler(context.Background(), s.cluster)
h.ServeHTTP(resp, req)
c.Check(resp.Code, check.Equals, http.StatusInternalServerError)
c.Check(resp.Body.String(), check.Equals, "")