MCPcopy Create free account
hub / github.com/asternic/wuzapi / handleRequest

Method handleRequest

stdio.go:162–182  ·  view source on GitHub ↗
(requestBytes []byte)

Source from the content-addressed store, hash-verified

160}
161
162func (ss *stdioServer) handleRequest(requestBytes []byte) {
163 var req jsonRpcRequest
164 if err := json.Unmarshal(requestBytes, &req); err != nil {
165 ss.sendError(ID{}, 400, fmt.Sprintf("invalid JSON request: %v", err))
166 return
167 }
168 // ID is required - check if it was present in the JSON
169 if !req.ID.IsSet {
170 ss.sendError(ID{}, 400, "missing request id")
171 return
172 }
173 if req.Method == "" {
174 ss.sendError(req.ID, 400, "missing method")
175 return
176 }
177 log.Info().
178 Str("id", req.ID.String()).
179 Str("method", req.Method).
180 Msg("Processing stdio request")
181 ss.routeRequest(&req)
182}
183
184// routeRequest dispatches the request to the appropriate HTTP handler
185// getUserIdParam extracts and validates userId from request params

Callers 1

StartMethod · 0.95

Calls 3

sendErrorMethod · 0.95
routeRequestMethod · 0.95
StringMethod · 0.80

Tested by

no test coverage detected