@@ -22,7 +22,6 @@ import (
2222 "encoding/json"
2323 "fmt"
2424 "io"
25- "net/http"
2625 "sort"
2726 "strings"
2827
@@ -34,7 +33,7 @@ import (
3433 "olympos.io/encoding/edn"
3534
3635 "github.com/atomist-skills/go-skill"
37-
36+ "github.com/docker/index-cli-plugin/internal/ddhttp"
3837 "github.com/docker/index-cli-plugin/types"
3938)
4039
@@ -94,7 +93,7 @@ func Detect(sb *types.Sbom, excludeSelf bool, workspace string, apiKey string) (
9493func ForBaseImageInIndex (digest digest.Digest , workspace string , apiKey string ) (* []types.Image , error ) {
9594 url := fmt .Sprintf ("https://api.dso.docker.com/docker-images/chain-ids/%s.json" , digest .String ())
9695
97- resp , err := http .Get (url )
96+ resp , err := ddhttp . DefaultClient () .Get (url )
9897 if err != nil {
9998 return nil , errors .Wrapf (err , "failed to query index" )
10099 }
@@ -243,7 +242,7 @@ func ForBaseImageInGraphQL(cfg *v1.ConfigFile) (*types.BaseImagesByDiffIdsQuery,
243242 }
244243
245244 url := "https://api.dso.docker.com/v1/graphql"
246- client := graphql .NewClient (url , nil )
245+ client := graphql .NewClient (url , ddhttp . DefaultClient () )
247246 variables := map [string ]interface {}{
248247 "diffIds" : diffIds ,
249248 }
@@ -270,7 +269,7 @@ func ForBaseImageInGraphQL(cfg *v1.ConfigFile) (*types.BaseImagesByDiffIdsQuery,
270269
271270func ForImageInGraphQL (sb * types.Sbom ) (* types.ImageByDigestQuery , error ) {
272271 url := "https://api.dso.docker.com/v1/graphql"
273- client := graphql .NewClient (url , nil )
272+ client := graphql .NewClient (url , ddhttp . DefaultClient () )
274273 variables := map [string ]interface {}{
275274 "digest" : sb .Source .Image .Digest ,
276275 "os" : sb .Source .Image .Platform .Os ,
0 commit comments