Skip to content

Commit

Permalink
fastfix: JsonRpc_Notify_Response
Browse files Browse the repository at this point in the history
  • Loading branch information
WiRight committed Aug 10, 2023
1 parent 533077a commit 702fb22
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,27 @@ func CustomHandler(rawJsonData []byte) string {
var responses []string

for _, item := range request.([]any) {
responses = append(responses, processRequest(item.(map[string]any)))
r := processRequest(item.(map[string]any))

if r != notifyResponse {
responses = append(responses, r)
}
}

var rr []string
for _, r := range responses {
if r != "" {
if r != "" && r != notifyResponse {
rr = append(rr, r)
}
}

response = fmt.Sprintf("[%s]", strings.Join(rr, ","))
} else {
response = processRequest(request.(map[string]any))

if response == notifyResponse {
response = ""
}
}

return response
Expand Down

0 comments on commit 702fb22

Please sign in to comment.