diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eb644880c..d857b4d2a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ## [Unreleased] ### Fixed - Correctly display MFA-related configuration in devconsole UI. +- Correctly extract RPC function identifiers. ## [3.24.1] - 2024-10-21 ### Changed diff --git a/server/api_rpc.go b/server/api_rpc.go index 29449fdd14..81615ef3d0 100644 --- a/server/api_rpc.go +++ b/server/api_rpc.go @@ -23,6 +23,7 @@ import ( "time" "github.com/gofrs/uuid/v5" + "github.com/gorilla/mux" grpcgw "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/heroiclabs/nakama-common/api" "go.uber.org/zap" @@ -110,8 +111,8 @@ func (s *ApiServer) RpcFuncHttp(w http.ResponseWriter, r *http.Request) { }() // Check the RPC function ID. - maybeID := r.PathValue("id") - if maybeID == "" { + maybeID, ok := mux.Vars(r)["id"] + if !ok || maybeID == "" { // Missing RPC function ID. w.Header().Set("content-type", "application/json") w.WriteHeader(http.StatusBadRequest)