Add httpHeaders to httpGet liveness probe

Also update existing documentation and try to steer users away from 'host'.
Add validation.
This commit is contained in:
Rudi Chiarito
2016-02-02 10:03:50 -05:00
parent faa0fc3d8c
commit a2d1bb7acf
27 changed files with 30025 additions and 28798 deletions

View File

@@ -167,3 +167,13 @@ var percentRegexp = regexp.MustCompile("^" + percentFmt + "$")
func IsValidPercent(percent string) bool {
return percentRegexp.MatchString(percent)
}
const HTTPHeaderNameFmt string = "[-A-Za-z0-9]+"
var httpHeaderNameRegexp = regexp.MustCompile("^" + HTTPHeaderNameFmt + "$")
// IsHTTPHeaderName checks that a string conforms to the Go HTTP library's
// definition of a valid header field name (a stricter subset than RFC7230).
func IsHTTPHeaderName(value string) bool {
return httpHeaderNameRegexp.MatchString(value)
}