Skip to content

Commit

Permalink
fix user agent formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
philippta committed Nov 24, 2024
1 parent 26a033b commit 653be45
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/headers/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@ import (

//go:embed versions_chrome.txt
var versionsChromeRaw string
var versionsChrome = strings.Split("\n", strings.TrimSpace(versionsChromeRaw))
var versionsChrome = strings.Split(strings.TrimSpace(versionsChromeRaw), "\n")

//go:embed versions_firefox.txt
var versionsFirefoxRaw string
var versionsFirefox = strings.Split("\n", strings.TrimSpace(versionsFirefoxRaw))
var versionsFirefox = strings.Split(strings.TrimSpace(versionsFirefoxRaw), "\n")

//go:embed versions_edge.txt
var versionsEdgeRaw string
var versionsEdge = strings.Split("\n", strings.TrimSpace(versionsEdgeRaw))
var versionsEdge = strings.Split(strings.TrimSpace(versionsEdgeRaw), "\n")

//go:embed versions_opera.txt
var versionsOperaRaw string
var versionsOpera = strings.Split("\n", strings.TrimSpace(versionsOperaRaw))
var versionsOpera = strings.Split(strings.TrimSpace(versionsOperaRaw), "\n")

//go:embed versions_macos.txt
var versionsMacOSRaw string
var versionsMacOS = strings.Split("\n", strings.TrimSpace(versionsMacOSRaw))
var versionsMacOS = strings.Split(strings.TrimSpace(versionsMacOSRaw), "\n")

//go:embed versions_windows.txt
var versionsWindowsRaw string
var versionsWindows = strings.Split("\n", strings.TrimSpace(versionsWindowsRaw))
var versionsWindows = strings.Split(strings.TrimSpace(versionsWindowsRaw), "\n")

//go:embed versions_linux.txt
var versionsLinuxRaw string
var versionsLinux = strings.Split("\n", strings.TrimSpace(versionsLinuxRaw))
var versionsLinux = strings.Split(strings.TrimSpace(versionsLinuxRaw), "\n")

func randomUAChrome() string {
f := "Mozilla/5.0 (%s) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36"
Expand All @@ -61,7 +61,7 @@ func randomUAEdge() string {
}

func randomUAOpera() string {
f := "Mozilla/5.0 (%s) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 OPR/"
f := "Mozilla/5.0 (%s) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 OPR/%s"
return fmt.Sprintf(f, randomOS(), random(versionsOpera))
}

Expand Down

0 comments on commit 653be45

Please sign in to comment.