-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport non-webconnectivity changes from master
This applies all the changes in master since when we branched off except the changes that rewrite webconnectivity in Go. Part of #757.
- Loading branch information
1 parent
e5b9c07
commit 7b34ba5
Showing
23 changed files
with
103 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package httpheader | ||
|
||
// RandomAccept returns a random Accept header. | ||
func RandomAccept() string { | ||
// This is the same that is returned by MK. We have #147 to | ||
// ensure that headers are randomized, if needed. | ||
// 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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package httpheader | ||
|
||
// RandomAcceptLanguage returns a random Accept-Language header | ||
func RandomAcceptLanguage() string { | ||
// This is the same that is returned by MK. We have #147 to | ||
// ensure that headers are randomized, if needed. | ||
// AcceptLanguage returns the Accept-Language header used for measuring. | ||
func AcceptLanguage() string { | ||
return "en-US;q=0.8,en;q=0.5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
// Package httpheader contains code to set common HTTP headers. | ||
package httpheader | ||
|
||
// RandomUserAgent returns a random User-Agent | ||
func RandomUserAgent() string { | ||
// TODO(bassosimone): this user-agent solution is temporary and we | ||
// should instead select one among many user agents. See #147. | ||
// | ||
// 14.9% as of Jun 25, 2020 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/83.0.4103.61 Safari/537.36" | ||
// UserAgent returns the User-Agent header used for measuring. | ||
func UserAgent() string { | ||
// 18.2% as of Jul 21, 2020 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/83.0.4103.116 Safari/537.36" | ||
return ua | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.