Skip to content

Commit

Permalink
Correctly extract RPC function identifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyro committed Oct 22, 2024
1 parent 7126240 commit 13bf48b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions server/api_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 13bf48b

Please sign in to comment.