From 4fe6834ba51a2a892527ce2f6af68c0588e0fae6 Mon Sep 17 00:00:00 2001 From: psr Date: Wed, 10 Jan 2024 05:18:43 +0530 Subject: [PATCH] http endpoint cleanup (#13432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka --- validator/rpc/handlers_keymanager.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/validator/rpc/handlers_keymanager.go b/validator/rpc/handlers_keymanager.go index 1977962f55..89094d35ef 100644 --- a/validator/rpc/handlers_keymanager.go +++ b/validator/rpc/handlers_keymanager.go @@ -10,7 +10,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared" fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams" @@ -705,14 +704,8 @@ func (s *Server) GetGasLimit(w http.ResponseWriter, r *http.Request) { return } - rawPubkey := mux.Vars(r)["pubkey"] - if rawPubkey == "" { - httputil.HandleError(w, "pubkey is required in URL params", http.StatusBadRequest) - return - } - - pubkey, valid := shared.ValidateHex(w, "pubkey", rawPubkey, fieldparams.BLSPubkeyLength) - if !valid { + rawPubkey, pubkey, ok := shared.HexFromRoute(w, r, "pubkey", fieldparams.BLSPubkeyLength) + if !ok { return }