Change:
<!-- Please only use this template for submitting enhancement requests --What would you like to be : I would like that besides User-agent we the Accept header as well with the "acept all" default. Just like curl does. Why is this needed: Because it was my expectation that the probe would work similarly to a curl but is not the case. I think more folks can hit this situation and waste some time to finally sort it out If this is not something you would like to add I would then like the docs to mention this specifically. _ PS: I would love to propose the improvement my self
/sig node network
/assign
Is the goal simply to avoid tripping over servers that look for that header? I don't think this presents any hazards - is that right? If so, it seems like a simple PR if you want to tackle it. /triage accepted /kind feature
cool! will look into it! thanks :)
Hello sorry but be bugging you, but I have opened the PR but I had 0 response since then. I think I have met all the requirements, so I was wondering (as this is my first PR in k8s) if you could help me a bit. Thanks anyway.

Discussion:
v := version.Get() headers.Set("User-Agent", fmt.Sprintf("kube-probe/%s.%s", v.Major, v.Minor)) } <ins> if _, ok := headers["Accept"]; !ok { // Accept header was not defined. accept all headers.Set("Accept", "*/*") } if headers.Get("Accept") == "" { // Accept header was overridden but is empty. removing headers.Del("Accept") } </ins> req.Header = headers if headers.Get("Host") != "" { req.Host = headers.Get("Host")

"net/http/httptest" "net/url" "os" <ins> "sort" </ins> "strconv" "strings" "testing"

w.Write([]byte(output)) } <ins> // Handler that returns the number of request headers in the body headerCounterHandler := func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) w.Write([]byte(strconv.Itoa(len(r.Header)))) } // Handler that returns the keys of request headers in the body headerKeysNamesHandler := func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) keys := make([]string, 0, len(r.Header)) for k := range r.Header { keys = append(keys, k) } sort.Strings(keys) w.Write([]byte(strings.Join(keys, "n"))) } </ins> redirectHandler := func(s int, bad bool) func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/" {

accBody: "ok body", }, { <ins> handler:    headerCounterHandler, reqHeaders: http.Header{}, health:     probe.Success, accBody:    "4", }, { handler:    headerKeysNamesHandler, reqHeaders: http.Header{}, health:     probe.Success, accBody:    "AcceptnAccept-EncodingnConnectionnUser-Agent", }, { </ins> handler: headerEchoHandler, reqHeaders: http.Header{ "X-Muffins-Or-Cupcakes": {"muffins"},

accBody:    "User-Agent: kube-probe/", }, { <ins> handler: headerEchoHandler, reqHeaders: http.Header{ "User-Agent": {"foo/1.0"}, "Accept":     {"text/html"}, }, health:  probe.Success, accBody: "Accept: text/html", }, { handler: headerEchoHandler, reqHeaders: http.Header{ "User-Agent": {"foo/1.0"}, "Accept":     {"foo/*"}, }, health:  probe.Success, accBody: "User-Agent: foo/1.0", }, { handler: headerEchoHandler, reqHeaders: http.Header{ "X-Muffins-Or-Cupcakes": {"muffins"}, "Accept":                {"foo/*"}, }, health:  probe.Success, accBody: "X-Muffins-Or-Cupcakes: muffins", }, { handler: headerEchoHandler, reqHeaders: http.Header{ "Accept": {"foo/*"}, }, health:  probe.Success, accBody: "Accept: foo/*", }, { handler: headerEchoHandler, reqHeaders: http.Header{ "Accept": {""}, }, health:  probe.Success, notBody: "Accept:", }, { handler: headerEchoHandler, reqHeaders: http.Header{ "User-Agent": {"foo/1.0"}, "Accept":     {""}, }, health:  probe.Success, notBody: "Accept:", }, { handler:    headerEchoHandler, reqHeaders: http.Header{}, health:     probe.Success, accBody:    "Accept: */*", }, { </ins> // Echo handler that returns the contents of Host in the body handler: func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200)