mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-02-01 00:03:15 +08:00
refactor(runner): adjust max-host-error if gt concurrency (#5633)
* refactor(common): use `ParseRequestURI` instead when `NormalizeCacheValue` also it exports the method Signed-off-by: Dwi Siswanto <git@dw1.io> * refactor(runner): adjust `max-host-error` if gt `concurrency` Signed-off-by: Dwi Siswanto <git@dw1.io> * fix lint * chore(runner): expose adjusted `max-host-error` value Signed-off-by: Dwi Siswanto <git@dw1.io> --------- Signed-off-by: Dwi Siswanto <git@dw1.io> Co-authored-by: Doğan Can Bakır <dogancanbakir@protonmail.com>
This commit is contained in:
@@ -109,7 +109,7 @@ func TestCacheMarkFailedConcurrent(t *testing.T) {
|
||||
|
||||
// the cache is not atomic during items creation, so we pre-create them with counter to zero
|
||||
for _, test := range tests {
|
||||
normalizedValue := cache.normalizeCacheValue(test.host)
|
||||
normalizedValue := cache.NormalizeCacheValue(test.host)
|
||||
newItem := &cacheItem{errors: atomic.Int32{}}
|
||||
newItem.errors.Store(0)
|
||||
_ = cache.failedTargets.Set(normalizedValue, newItem)
|
||||
@@ -131,7 +131,7 @@ func TestCacheMarkFailedConcurrent(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
require.True(t, cache.Check(newCtxArgs(test.host)))
|
||||
|
||||
normalizedCacheValue := cache.normalizeCacheValue(test.host)
|
||||
normalizedCacheValue := cache.NormalizeCacheValue(test.host)
|
||||
failedTarget, err := cache.failedTargets.Get(normalizedCacheValue)
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, failedTarget)
|
||||
|
||||
Reference in New Issue
Block a user