From 6133f44344fa244bf88c6d76c961e53a0db9aa2f Mon Sep 17 00:00:00 2001 From: Jordan Whited Date: Wed, 9 Apr 2025 13:43:29 -0700 Subject: [PATCH] ipn/ipnlocal: fix peerapi ingress endpoint (#15611) The http.StatusMethodNotAllowed status code was being erroneously set instead of http.StatusBadRequest in multiple places. Updates #cleanup Signed-off-by: Jordan Whited --- ipn/ipnlocal/peerapi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipn/ipnlocal/peerapi.go b/ipn/ipnlocal/peerapi.go index 21b808fd5..888b876d6 100644 --- a/ipn/ipnlocal/peerapi.go +++ b/ipn/ipnlocal/peerapi.go @@ -417,7 +417,7 @@ func (h *peerAPIHandler) handleServeIngress(w http.ResponseWriter, r *http.Reque } logAndError := func(code int, publicMsg string) { h.logf("ingress: bad request from %v: %s", h.remoteAddr, publicMsg) - http.Error(w, publicMsg, http.StatusMethodNotAllowed) + http.Error(w, publicMsg, code) } bad := func(publicMsg string) { logAndError(http.StatusBadRequest, publicMsg)