mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-05 20:40:16 -08:00
fix(server): add HTTP transport setup to server mode (#9217)
Co-authored-by: knqyf263 <knqyf263@users.noreply.github.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user