fix(server): add HTTP transport setup to server mode (#9217)

Co-authored-by: knqyf263 <knqyf263@users.noreply.github.com>
This commit is contained in:
Teppei Fukuda
2025-07-21 13:01:58 +04:00
committed by GitHub
parent 362be17f7e
commit 1163b044c7

View File

@@ -12,12 +12,19 @@ import (
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasecurity/trivy/pkg/module"
rpcServer "github.com/aquasecurity/trivy/pkg/rpc/server"
xhttp "github.com/aquasecurity/trivy/pkg/x/http"
)
// Run runs the scan
func Run(ctx context.Context, opts flag.Options) (err error) {
log.InitLogger(opts.Debug, opts.Quiet)
// Set the default HTTP transport
xhttp.SetDefaultTransport(xhttp.NewTransport(xhttp.Options{
Insecure: opts.Insecure,
Timeout: opts.Timeout,
}))
// configure cache dir
cacheClient, cleanup, err := cache.New(opts.CacheOpts())
if err != nil {