{"record":{"id":"79603db2cc49edeb","repo":"shadow1ng/fscan","slug":"webscan-err-invalid-url","errorCode":null,"errorMessage":"webscan_err_invalid_url","messagePattern":"webscan_err_invalid_url","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"webscan/web_scan.go","lineNumber":36,"sourceCode":"\t\"github.com/shadow1ng/fscan/common\"\n\t\"github.com/shadow1ng/fscan/common/config\"\n\t\"github.com/shadow1ng/fscan/common/i18n\"\n\t\"github.com/shadow1ng/fscan/webscan/lib\"\n)\n\n// 常量定义\nconst (\n\tprotocolHTTP     = \"http://\"\n\tprotocolHTTPS    = \"https://\"\n\tyamlExt          = \".yaml\"\n\tymlExt           = \".yml\"\n\tdefaultTimeout   = 30 * time.Second\n\tconcurrencyLimit = 10 // 并发加载POC的限制\n)\n\n// 错误定义\nvar (\n\tErrInvalidURL    = errors.New(i18n.GetText(\"webscan_err_invalid_url\"))\n\tErrEmptyTarget   = errors.New(i18n.GetText(\"webscan_err_empty_target\"))\n\tErrPocNotFound   = errors.New(i18n.GetText(\"webscan_err_poc_not_found\"))\n\tErrPocLoadFailed = errors.New(i18n.GetText(\"webscan_err_poc_load_failed\"))\n)\n\n//go:embed pocs\nvar pocsFS embed.FS\n\n// pocStore 按 PocPath 缓存已加载的 POC 集合，支持多 session 使用不同 POC 路径\ntype pocStore struct {\n\tmu    sync.Mutex\n\tcache map[string][]*lib.Poc // key: pocPath（空字符串表示内嵌 POC）\n}\n\nvar globalPocStore = &pocStore{cache: make(map[string][]*lib.Poc)}\n\n// WebScan 执行Web漏洞扫描\nfunc WebScan(ctx context.Context, info *common.HostInfo, cfg *common.Config, session *common.ScanSession) {","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/webscan/web_scan.go#L18-L54","documentation":"ErrInvalidURL (message text localized via i18n key webscan_err_invalid_url): guard in web-scan URL normalization when url.Parse fails or the parsed URL has an empty host, meaning the target string is not a usable absolute URL for the web scanner.","triggerScenarios":"Thrown at webscan/web_scan.go:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a full URL with scheme and host, e.g. http://target:8080/","Pre-validate user-supplied URL lists before scanning","Strip entries that fail URL parsing and report them separately"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}