remove usage of appengine to get rid of unsafe imports

This commit is contained in:
2023-12-21 17:13:45 +01:00
parent 6e9ec9323d
commit 1a4068ead1
8 changed files with 1 additions and 197 deletions

View File

@@ -18,16 +18,11 @@ var HTTPClient ContextKey
// because nobody else can create a ContextKey, being unexported.
type ContextKey struct{}
var appengineClientHook func(context.Context) *http.Client
func ContextClient(ctx context.Context) *http.Client {
if ctx != nil {
if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok {
return hc
}
}
if appengineClientHook != nil {
return appengineClientHook(ctx)
}
return http.DefaultClient
}