You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rpc: RPC over HTTP can't find a controller whose name needs URL encoding #773
A controller named 'größe' or 'admin tools' answers over WebSocket, but over RpcHttpClientAdapter the server looks up the percent-encoded name and fails.
import{App}from'@deepkit/app';import{ApplicationServer,FrameworkModule}from'@deepkit/framework';import{rpc,RpcClient,RpcHttpClientAdapter,RpcWebSocketClient}from'@deepkit/rpc';
@rpc.controller('größe')classSizeController{
@rpc.action()hello(): string{return'größe';}}
@rpc.controller('admin tools')classAdminToolsController{
@rpc.action()hello(): string{return'admin tools';}}constapp=newApp({controllers: [SizeController,AdminToolsController],imports: [newFrameworkModule({port: 8080,httpRpcBasePath: '/api'})]});awaitapp.get(ApplicationServer).start();constws=newRpcWebSocketClient('ws://127.0.0.1:8080');console.log(awaitws.controller<SizeController>('größe').hello());// 'größe'consthttp=newRpcClient(newRpcHttpClientAdapter('http://127.0.0.1:8080/api'));console.log(awaithttp.controller<SizeController>('größe').hello().catch((error: Error)=>error.message));// actual: 'No controller registered for id gr%C3%B6%C3%9Fe', should be: 'größe'console.log(awaithttp.controller<AdminToolsController>('admin tools').hello().catch((error: Error)=>error.message));// actual: 'No controller registered for id admin%20tools', should be: 'admin tools'
Activity