refactor: move more commands to internal/cmd (#207)
* refactor: move more commands to internal/cmd Part of https://github.com/ooni/probe/issues/1335. We would like all commands to be at the same level of engine rather than inside engine (now that we can do it). * fix: update .gitignore * refactor: also move jafar outside engine * We should be good now?
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package httpheader
|
||||
|
||||
// Accept returns the Accept header used for measuring.
|
||||
func Accept() string {
|
||||
return "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package httpheader
|
||||
|
||||
// AcceptLanguage returns the Accept-Language header used for measuring.
|
||||
func AcceptLanguage() string {
|
||||
return "en-US;q=0.8,en;q=0.5"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Package httpheader contains code to set common HTTP headers.
|
||||
package httpheader
|
||||
|
||||
// UserAgent returns the User-Agent header used for measuring.
|
||||
func UserAgent() string {
|
||||
// 12.0% as of Jan 29, 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/87.0.4280.141 Safari/537.36"
|
||||
return ua
|
||||
}
|
||||
|
||||
// CLIUserAgent returns the User-Agent used when we want to
|
||||
// pretent to be a command line HTTP client.
|
||||
func CLIUserAgent() string {
|
||||
// here we always put the latest version of cURL.
|
||||
return "curl/7.73.0"
|
||||
}
|
||||
Reference in New Issue
Block a user