Skip to content

Commit

Permalink
use 404 for anything other than /ping
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Savintsev <[email protected]>
  • Loading branch information
dmitris committed Sep 27, 2023
1 parent 2334fbe commit bae3734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/generated/restapi/configure_timestamp_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func httpPingOnly(endpoint string) func(http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
if r.URL.Scheme != "https" && !strings.EqualFold(r.URL.Path, endpoint) {
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(http.StatusForbidden)
w.WriteHeader(http.StatusNotFound)
w.Write([]byte("http server supports only the /ping entrypoint")) //nolint:errcheck
return
}
Expand Down

0 comments on commit bae3734

Please sign in to comment.