Skip to content

Commit

Permalink
Fix #89: default to "unknown"
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinB committed Jul 23, 2024
1 parent 9f0e91c commit 24ee782
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions internal/pkg/crawl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,6 @@ func GenerateCrawlConfig(config *config.Config) (*Crawl, error) {
c.UserAgent = config.UserAgent
} else {
version := utils.GetVersion()

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

c.UserAgent = "Mozilla/5.0 (compatible; archive.org_bot +http://archive.org/details/archive.org_bot) Zeno/" + version.Version + " warc/" + version.WarcVersion
}
c.Headless = config.Headless
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/utils/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ type Version struct {
}

func GetVersion() (version Version) {
// Defaults to master
version.Version = "master"
// Defaults to "unknown"
version.Version = "unknown"

if info, ok := debug.ReadBuildInfo(); ok {
// Determine Zeno's version based on Git data
Expand Down

0 comments on commit 24ee782

Please sign in to comment.