From 82733cc45dcd2e7a795884dec0bceae393db15f6 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 14 Mar 2018 15:52:56 +0900 Subject: [PATCH] ing --- internal/server/rpc/gateway_rpc_servlet_handlers.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/internal/server/rpc/gateway_rpc_servlet_handlers.go b/internal/server/rpc/gateway_rpc_servlet_handlers.go index 5bff1d6..b3b8322 100644 --- a/internal/server/rpc/gateway_rpc_servlet_handlers.go +++ b/internal/server/rpc/gateway_rpc_servlet_handlers.go @@ -2,11 +2,12 @@ package rpc import ( "context" + "encoding/json" "git.loafle.net/commons_go/rpc" "git.loafle.net/commons_go/rpc/gateway" "git.loafle.net/commons_go/rpc/protocol" - "git.loafle.net/commons_go/rpc/protocol/json" + crpj "git.loafle.net/commons_go/rpc/protocol/json" oogw "git.loafle.net/overflow/overflow_gateway_websocket" "git.loafle.net/overflow/overflow_gateway_websocket/external/grpc" "google.golang.org/grpc/metadata" @@ -14,7 +15,7 @@ import ( func newGatewayRPCServletHandler() GatewayRPCServletHandler { sh := &GatewayRPCServletHandlers{} - sh.RegisterCodec(json.Name, json.NewServerCodec()) + sh.RegisterCodec(crpj.Name, crpj.NewServerCodec()) return sh } @@ -36,7 +37,13 @@ func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, reque return nil, err } - return r, nil + var m interface{} + err = json.Unmarshal([]byte(r), &m) + if err != nil { + return nil, err + } + + return m, nil } func (sh *GatewayRPCServletHandlers) Validate() {