mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-01-31 15:53:10 +08:00
refactor: inverse HTTP cache (RFC 9111) logic (opt-in)
Signed-off-by: Dwi Siswanto <git@dw1.io>
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user