diff --git a/cve-vulner-manager/conf/product_app.conf b/cve-vulner-manager/conf/product_app.conf index 2711e78d2ae97c0690f918dc12877bcc7f96814f..a66e8bf3f7241d3beaeda9411698fd1de7900ebd 100644 --- a/cve-vulner-manager/conf/product_app.conf +++ b/cve-vulner-manager/conf/product_app.conf @@ -93,7 +93,7 @@ genexcelflag = 1 genexcel = 0 15 15 * * * days = -30 prcnum = 50 -printlogflag = 1 +printlogflag = 2 printlog = 0 0 1 * * 2,4,6 unlockflag = 1 unlock = 0 */5 * * * * diff --git a/cve-vulner-manager/cve-timed-task/util/crawl.go b/cve-vulner-manager/cve-timed-task/util/crawl.go index 71af4ef9f9ad46fd3723bf642768643f3dbd37c7..81a87ccebda032da3372c13dcfced9c5f44c43ec 100644 --- a/cve-vulner-manager/cve-timed-task/util/crawl.go +++ b/cve-vulner-manager/cve-timed-task/util/crawl.go @@ -1,18 +1,20 @@ package util import ( + "net/http" + "github.com/pkg/errors" "golang.org/x/net/html" "golang.org/x/net/html/charset" - "net/http" ) func UrlToHTML(url string) (*html.Node, error) { resp, err := http.Get(url) - defer resp.Body.Close() - if err != nil { + if err != nil || resp == nil { return nil, err } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { return nil, errors.New(resp.Status) }