mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 05:40:11 +01:00
Harvest only JSON files.
This commit is contained in:
parent
4428679822
commit
eaa2620eba
2 changed files with 11 additions and 5 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
)
|
||||
|
|
@ -66,6 +67,10 @@ func linksOnPage(r io.Reader, resolve func(string) (string, error)) ([]string, e
|
|||
return
|
||||
}
|
||||
if link, ok := s.Attr("href"); ok {
|
||||
// Only care for JSON files here.
|
||||
if !strings.HasSuffix(link, ".json") {
|
||||
return
|
||||
}
|
||||
if link, err = resolve(link); err == nil {
|
||||
links = append(links, link)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue