调整指纹收集的逻辑

This commit is contained in:
M09Ic 2023-02-19 22:27:16 +08:00
parent 296bea96a0
commit d62bbdf5df

View File

@ -120,7 +120,11 @@ func (bl *Baseline) IsDir() bool {
// Collect 深度收集信息 // Collect 深度收集信息
func (bl *Baseline) Collect() { func (bl *Baseline) Collect() {
if bl.ContentType == "html" || bl.ContentType == "json" || bl.ContentType == "txt" {
// 指纹库设计的时候没考虑js,css文件的指纹, 跳过非必要的指纹收集减少误报提高性能
bl.Frameworks = FingerDetect(string(bl.Raw)) bl.Frameworks = FingerDetect(string(bl.Raw))
}
if len(bl.Body) > 0 { if len(bl.Body) > 0 {
if bl.ContentType == "html" { if bl.ContentType == "html" {
bl.Title = iutils.AsciiEncode(parsers.MatchTitle(string(bl.Body))) bl.Title = iutils.AsciiEncode(parsers.MatchTitle(string(bl.Body)))