mirror of
https://github.com/logos-storage/nim-json-rpc.git
synced 2026-01-07 08:03:07 +00:00
use string.fromBytes to replace cast[string](bytes)
This commit is contained in:
parent
69e8be66fb
commit
b9e9be8f19
@ -2,6 +2,7 @@ import
|
||||
std/[strtabs, tables, uri, strutils],
|
||||
pkg/[chronos, ws/ws, chronicles],
|
||||
ws/extensions/compression/deflate,
|
||||
stew/byteutils,
|
||||
../client
|
||||
|
||||
export client
|
||||
@ -51,7 +52,7 @@ proc processData(client: RpcWebSocketClient) {.async.} =
|
||||
# transmission ends
|
||||
break
|
||||
|
||||
client.processMessage(cast[string](value))
|
||||
client.processMessage(string.fromBytes(value))
|
||||
except CatchableError as e:
|
||||
error = e
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import
|
||||
chronicles, httputils, chronos, ws/ws,
|
||||
ws/extensions/compression/deflate,
|
||||
stew/byteutils,
|
||||
".."/[errors, server]
|
||||
|
||||
export server
|
||||
@ -39,7 +40,7 @@ proc handleRequest(rpc: RpcWebSocketServer, request: HttpRequest) {.async.} =
|
||||
)
|
||||
break
|
||||
|
||||
let future = rpc.route(cast[string](recvData))
|
||||
let future = rpc.route(string.fromBytes(recvData))
|
||||
yield future
|
||||
if future.failed:
|
||||
debug "Internal error, while processing RPC call",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user