diff --git a/cmd/nuclei/main.go b/cmd/nuclei/main.go index bd417d6ce..6b6586531 100644 --- a/cmd/nuclei/main.go +++ b/cmd/nuclei/main.go @@ -434,8 +434,8 @@ on extensive configurability, massive extensibility and ease of use.`) }), flagSet.DurationVarP(&options.InputReadTimeout, "input-read-timeout", "irt", time.Duration(3*time.Minute), "timeout on input read"), flagSet.BoolVarP(&options.DisableHTTPProbe, "no-httpx", "nh", false, "disable httpx probing for non-url input"), - flagSet.BoolVarP(&options.DisableHTTPCache, "no-http-cache", "nhc", false, "disable HTTP cache (RFC 9111) for HTTP requests"), flagSet.BoolVar(&options.DisableStdin, "no-stdin", false, "disable stdin processing"), + flagSet.BoolVar(&options.EnableHTTPCache, "http-cache", false, "enable HTTP cache (RFC 9111) for HTTP requests"), ) flagSet.CreateGroup("headless", "Headless", diff --git a/pkg/protocols/http/httpclientpool/clientpool.go b/pkg/protocols/http/httpclientpool/clientpool.go index 8c21da09a..6fba767e8 100644 --- a/pkg/protocols/http/httpclientpool/clientpool.go +++ b/pkg/protocols/http/httpclientpool/clientpool.go @@ -223,7 +223,7 @@ func wrappedGet(options *types.Options, configuration *Configuration) (*retryabl if configuration.ResponseHeaderTimeout > 0 && configuration.ResponseHeaderTimeout > retryableHttpOptions.Timeout { retryableHttpOptions.Timeout = configuration.ResponseHeaderTimeout } - if !options.DisableHTTPCache && !configuration.DisableHTTPCache { + if options.EnableHTTPCache && !configuration.DisableHTTPCache { retryableHttpOptions.WrapTransport = httpcache.NewTransportWrapper() } diff --git a/pkg/types/types.go b/pkg/types/types.go index e757ce53d..303f5c254 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -204,8 +204,11 @@ type Options struct { DebugResponse bool // DisableHTTPProbe disables http probing feature of input normalization DisableHTTPProbe bool - // DisableHTTPCache disables HTTP caching (RFC 9111) for requests - DisableHTTPCache bool + // EnableHTTPCache enables HTTP caching (RFC 9111) for requests + // + // NOTE(dwisiswant0): this is experimental and might be enabled by default + // in the future releases. + EnableHTTPCache bool // LeaveDefaultPorts skips normalization of default ports LeaveDefaultPorts bool // AutomaticScan enables automatic tech based template execution @@ -559,7 +562,7 @@ func (options *Options) Copy() *Options { DebugRequests: options.DebugRequests, DebugResponse: options.DebugResponse, DisableHTTPProbe: options.DisableHTTPProbe, - DisableHTTPCache: options.DisableHTTPCache, + EnableHTTPCache: options.EnableHTTPCache, LeaveDefaultPorts: options.LeaveDefaultPorts, AutomaticScan: options.AutomaticScan, Silent: options.Silent,