master: update deps and set version to 3.12.0-alpha (#548)
* chore: update all workflows to use go1.17.2 See https://github.com/ooni/probe/issues/1815 * chore: update all dependencies See https://github.com/ooni/probe/issues/1815 * chore: run `go generate` See https://github.com/ooni/probe/issues/1815 * chore: update the user-agent Part of https://github.com/ooni/probe/issues/1815 * Set version to 3.12.0-alpha Part of https://github.com/ooni/probe/issues/1815 * fix: update to ooni/probe-assets@v0.5.0 This overcomes https://github.com/ooni/probe/issues/1836 in the CLI and, while there, let us also make maxminddb tests stricter. * fix(QA/Dockerfile): build using go1.17 See https://github.com/ooni/probe-cli/pull/547#issuecomment-947760839 * chore(mk): use go1.17.2 Part of https://github.com/ooni/probe/issues/1815 * fix(codeql): always run for master Otherwise we see a warning that there is no CodeQL information available for the base branch and this is sub-optimal. Part of https://github.com/ooni/probe/issues/1815
This commit is contained in:
@@ -2,18 +2,18 @@ package geolocate
|
||||
|
||||
import "testing"
|
||||
|
||||
const ipAddr = "35.204.49.125"
|
||||
const ipAddr = "8.8.8.8"
|
||||
|
||||
func TestLookupASN(t *testing.T) {
|
||||
asn, org, err := LookupASN(ipAddr)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if asn <= 0 {
|
||||
t.Fatal("unexpected ASN value")
|
||||
if asn != 15169 {
|
||||
t.Fatal("unexpected ASN value", asn)
|
||||
}
|
||||
if len(org) <= 0 {
|
||||
t.Fatal("unexpected org value")
|
||||
if org != "Google LLC" {
|
||||
t.Fatal("unexpected org value", org)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ func TestLookupCC(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(cc) != 2 {
|
||||
t.Fatal("does not seem a country code")
|
||||
if cc != "US" {
|
||||
t.Fatal("invalid country code", cc)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ package httpheader
|
||||
|
||||
// UserAgent returns the User-Agent header used for measuring.
|
||||
func UserAgent() string {
|
||||
// 11.0% as of May 13, 2021 according to https://techblog.willshouse.com/2012/01/03/most-common-user-agents/
|
||||
const ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36"
|
||||
// 10.0% as of Oct 20, 2021 according to https://techblog.willshouse.com/2012/01/03/most-common-user-agents/
|
||||
const ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
|
||||
return ua
|
||||
}
|
||||
|
||||
@@ -12,5 +12,5 @@ func UserAgent() string {
|
||||
// pretent to be a command line HTTP client.
|
||||
func CLIUserAgent() string {
|
||||
// here we always put the latest version of cURL.
|
||||
return "curl/7.76.1"
|
||||
return "curl/7.79.1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user