Fixing client initialization (#73)
This commit is contained in:
committed by
GitHub
parent
a055c4c988
commit
78d1ff52c4
@@ -88,12 +88,9 @@ func main() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClientString string
|
|
||||||
|
|
||||||
func withGitlabContext(next http.HandlerFunc, c Client) http.Handler {
|
func withGitlabContext(next http.HandlerFunc, c Client) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
var cl ClientString = "client"
|
ctx := context.WithValue(context.Background(), "client", c) //nolint:all
|
||||||
ctx := context.WithValue(context.Background(), cl, c)
|
|
||||||
next.ServeHTTP(w, r.WithContext(ctx))
|
next.ServeHTTP(w, r.WithContext(ctx))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user