Skip to content

Commit 35cd6c5

Browse files
authored
Fix --http-ping-only flag to not affect https listener (#1051)
Signed-off-by: mktgbnk <[email protected]>
1 parent 815fe94 commit 35cd6c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/generated/restapi/configure_timestamp_server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const pingPath = "/ping"
110110
func httpPingOnly() func(http.Handler) http.Handler {
111111
f := func(h http.Handler) http.Handler {
112112
fn := func(w http.ResponseWriter, r *http.Request) {
113-
if r.URL.Scheme != "https" && !strings.EqualFold(r.URL.Path, pingPath) {
113+
if r.TLS == nil && !strings.EqualFold(r.URL.Path, pingPath) {
114114
w.Header().Set("Content-Type", "text/plain")
115115
w.WriteHeader(http.StatusNotFound)
116116
w.Write([]byte("http server supports only the " + pingPath + " entrypoint")) //nolint:errcheck

0 commit comments

Comments
 (0)