mirror of
https://github.com/chainreactors/spray.git
synced 2025-09-15 11:40:13 +00:00
fix: check pool net set headers
This commit is contained in:
parent
c746c26ff9
commit
08ce95b43d
@ -107,14 +107,6 @@ type BrutePool struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pool *BrutePool) Init() error {
|
func (pool *BrutePool) Init() error {
|
||||||
if pool.Headers.Get("User-Agent") == "" {
|
|
||||||
pool.Headers.Set("User-Agent", pkg.DefaultUserAgent)
|
|
||||||
}
|
|
||||||
|
|
||||||
if pool.Headers.Get("Accept") == "" {
|
|
||||||
pool.Headers.Set("Accept", "*/*")
|
|
||||||
}
|
|
||||||
|
|
||||||
pool.initwg.Add(2)
|
pool.initwg.Add(2)
|
||||||
if pool.Index != "/" {
|
if pool.Index != "/" {
|
||||||
logs.Log.Logf(pkg.LogVerbose, "custom index url: %s", pkg.BaseURL(pool.url)+pkg.FormatURL(pkg.BaseURL(pool.url), pool.Index))
|
logs.Log.Logf(pkg.LogVerbose, "custom index url: %s", pkg.BaseURL(pool.url)+pkg.FormatURL(pkg.BaseURL(pool.url), pool.Index))
|
||||||
|
@ -36,7 +36,7 @@ func NewCheckPool(ctx context.Context, config *Config) (*CheckPool, error) {
|
|||||||
processCh: make(chan *baseline.Baseline, config.Thread),
|
processCh: make(chan *baseline.Baseline, config.Thread),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
pool.Headers = map[string]string{"Connection": "close"}
|
pool.Headers.Set("Connection", "close")
|
||||||
p, _ := ants.NewPoolWithFunc(config.Thread, pool.Invoke)
|
p, _ := ants.NewPoolWithFunc(config.Thread, pool.Invoke)
|
||||||
|
|
||||||
pool.Pool = p
|
pool.Pool = p
|
||||||
|
@ -114,6 +114,14 @@ func (r *Runner) PrepareConfig() *pool.Config {
|
|||||||
config.Headers.Set(k, v)
|
config.Headers.Set(k, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.Headers.Get("User-Agent") == "" {
|
||||||
|
config.Headers.Set("User-Agent", pkg.DefaultUserAgent)
|
||||||
|
}
|
||||||
|
|
||||||
|
if config.Headers.Get("Accept") == "" {
|
||||||
|
config.Headers.Set("Accept", "*/*")
|
||||||
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user