mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
fix: -nopoc 禁用POC时不再输出错误日志
This commit is contained in:
@@ -4,7 +4,6 @@ package web
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/shadow1ng/fscan/common"
|
"github.com/shadow1ng/fscan/common"
|
||||||
@@ -92,8 +91,8 @@ func (p *WebPocPlugin) Scan(ctx context.Context, info *common.HostInfo, session
|
|||||||
config := session.Config
|
config := session.Config
|
||||||
if config.POC.Disabled {
|
if config.POC.Disabled {
|
||||||
return &WebScanResult{
|
return &WebScanResult{
|
||||||
Success: false,
|
Success: true,
|
||||||
Error: fmt.Errorf("%s", i18n.GetText("webpoc_disabled")),
|
Skipped: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ func TestWebPocEarlyReturnBranches(t *testing.T) {
|
|||||||
|
|
||||||
cfg.POC.Disabled = true
|
cfg.POC.Disabled = true
|
||||||
disabled := plugin.Scan(context.Background(), info, session)
|
disabled := plugin.Scan(context.Background(), info, session)
|
||||||
if disabled.Success || disabled.Error == nil {
|
if !disabled.Skipped {
|
||||||
t.Fatalf("disabled scan = %#v, want failed result with error", disabled)
|
t.Fatalf("disabled scan = %#v, want skipped result", disabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.POC.Disabled = false
|
cfg.POC.Disabled = false
|
||||||
|
|||||||
Reference in New Issue
Block a user