MCPcopy
hub / github.com/pingc0y/URLFinder / UrlDispose

Function UrlDispose

util/utils.go:68–89  ·  view source on GitHub ↗

对结果进行URL排序

(arr []mode.Link, url, host string)

Source from the content-addressed store, hash-verified

66
67// 对结果进行URL排序
68func UrlDispose(arr []mode.Link, url, host string) ([]mode.Link, []mode.Link) {
69 var urls []mode.Link
70 var urlts []mode.Link
71 var other []mode.Link
72 for _, v := range arr {
73 if strings.Contains(v.Url, url) {
74 urls = append(urls, v)
75 } else {
76 if host != "" && regexp.MustCompile(host).MatchString(v.Url) {
77 urlts = append(urlts, v)
78 } else {
79 other = append(other, v)
80 }
81 }
82 }
83
84 for _, v := range urlts {
85 urls = append(urls, v)
86 }
87
88 return RemoveRepeatElement(urls), RemoveRepeatElement(other)
89}
90
91// 处理Headers配置
92func SetHeadersConfig(header *http.Header) *http.Header {

Callers 5

OutFileCsvFunction · 0.92
OutFileJsonFunction · 0.92
OutFileHtmlFunction · 0.92
PrintFunction · 0.92
UrlFuzzFunction · 0.92

Calls 1

RemoveRepeatElementFunction · 0.85

Tested by

no test coverage detected