Add wrapper for github.com/gorilla/mux to resolve multi-repo context key issues

This commit is contained in:
Daniel 2019-07-04 13:45:47 +02:00
parent 6f5a67fde2
commit 13e64209a6

View file

@ -39,3 +39,8 @@ func Serve() {
log.Infof("api: starting to listen on %s", address)
log.Errorf("api: failed to listen on %s: %s", address, http.ListenAndServe(address, mainMux))
}
// GetMuxVars wraps github.com/gorilla/mux.Vars in order to mitigate context key issues in multi-repo projects.
func GetMuxVars(r *http.Request) map[string]string {
return mux.Vars(r)
}