Skip to content

Commit

Permalink
Merge pull request #130 from internetarchive/fix/libsyn
Browse files Browse the repository at this point in the history
fix: ensure there is no infinite recursion of URLs
  • Loading branch information
CorentinB authored Aug 14, 2024
2 parents c220114 + c10a3b6 commit e1cdcc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/pkg/crawl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func GenerateCrawlConfig(config *config.Config) (*Crawl, error) {
version := utils.GetVersion()

// If Version is a commit hash, we only take the first 7 characters
if len(version.Version) == 40 {
if len(version.Version) >= 40 {
version.Version = version.Version[:7]
}

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/crawl/sitespecific/libsyn/libsyn.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// into https://traffic.libsyn.com/secure/force-cdn/highwinds/democratieparticipative/DPS09E16.mp3
// So it's basically adding /secure/force-cdn/highwinds/ after the domain.
func IsLibsynURL(URL string) bool {
return strings.Contains(URL, "traffic.libsyn.com") && strings.HasSuffix(URL, ".mp3")
return strings.Contains(URL, "traffic.libsyn.com") && strings.HasSuffix(URL, ".mp3") && !strings.Contains(URL, "force-cdn/highwinds")
}

func GenerateHighwindsURL(URL string) (*url.URL, error) {
Expand Down

0 comments on commit e1cdcc4

Please sign in to comment.