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