routeRequest dispatches the request to the appropriate HTTP handler getUserIdParam extracts and validates userId from request params
(req *jsonRpcRequest)
| 184 | // routeRequest dispatches the request to the appropriate HTTP handler |
| 185 | // getUserIdParam extracts and validates userId from request params |
| 186 | func (ss *stdioServer) getUserIdParam(req *jsonRpcRequest) (string, bool) { |
| 187 | userId, ok := req.Params["userId"].(string) |
| 188 | if !ok || userId == "" { |
| 189 | ss.sendError(req.ID, 400, "missing or invalid userId parameter") |
| 190 | return "", false |
| 191 | } |
| 192 | return userId, true |
| 193 | } |
| 194 | |
| 195 | func (ss *stdioServer) routeRequest(req *jsonRpcRequest) { |
| 196 | // Map stdio method to HTTP route and method |