Skip to content

Commit

Permalink
chore: update user agent, reformat code, regenerate statics (#1429)
Browse files Browse the repository at this point in the history
Forked off the more complex #1428,
which was failing.

- run `./script/updateminipipeline.bash` 
- run `gofmt -s`
- run `go generate ./...`
- update user agent

See ooni/probe#2556
  • Loading branch information
bassosimone authored Dec 13, 2023
1 parent feb8c7d commit 32d4132
Show file tree
Hide file tree
Showing 14 changed files with 155 additions and 72 deletions.
6 changes: 3 additions & 3 deletions internal/model/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const (
HTTPHeaderAcceptLanguage = "en-US,en;q=0.9"

// HTTPHeaderUserAgent is the User-Agent header used for measuring. The current header
// is 20.2% of the browser population as of 2023-10-04 according to the
// https://techblog.willshouse.com/2012/01/03/most-common-user-agents/ webpage.
HTTPHeaderUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"
// is 17.34% of the browser population as of 2023-12-13 according to the
// https://www.useragents.me/ webpage.
HTTPHeaderUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.3"
)

// Additional strings used to report HTTP errors. They're currently only used by
Expand Down
197 changes: 140 additions & 57 deletions internal/netxlite/certifi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_darwin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_darwin_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_freebsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_freebsd_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_linux_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_openbsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_openbsd_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_windows.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/netxlite/errno_windows_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/testingsocks5/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (s *Server) handleConnect(ctx context.Context, cconn net.Conn, req *request
sconn, err := dialer.DialContext(ctx, "tcp", endpoint)
if err != nil {
// Note: the original go-socks5 selects the proper error but it does not
// matter for our purposes, so we always return hostUnreachable.
// matter for our purposes, so we always return hostUnreachable.
return sendReply(cconn, hostUnreachable, &net.TCPAddr{})
}
defer sconn.Close()
Expand Down

0 comments on commit 32d4132

Please sign in to comment.