mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 19:08:20 +00:00
fix missing jsonrpc id in response
This commit is contained in:
parent
5e49f9ba2e
commit
d9f8eda901
1 changed files with 3 additions and 3 deletions
|
@ -49,12 +49,12 @@ func (h *Handler) HandleRequest(ctx context.Context, r io.Reader, w io.Writer) e
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.Jsonrpc != "2.0" {
|
if req.Jsonrpc != "2.0" {
|
||||||
return respondError(w, "", ErrMethodNotFound, fmt.Errorf("Unsupported Jsonrpc version %v", req.Jsonrpc))
|
return respondError(w, req.ID, ErrMethodNotFound, fmt.Errorf("Unsupported Jsonrpc version %v", req.Jsonrpc))
|
||||||
}
|
}
|
||||||
|
|
||||||
method, ok := h.methods[req.Method]
|
method, ok := h.methods[req.Method]
|
||||||
if !ok {
|
if !ok {
|
||||||
return respondError(w, "", ErrMethodNotFound, fmt.Errorf("Unknown Method %v", req.Method))
|
return respondError(w, req.ID, ErrMethodNotFound, fmt.Errorf("Unknown Method %v", req.Method))
|
||||||
}
|
}
|
||||||
|
|
||||||
p := reflect.New(method.inType)
|
p := reflect.New(method.inType)
|
||||||
|
@ -64,7 +64,7 @@ func (h *Handler) HandleRequest(ctx context.Context, r io.Reader, w io.Writer) e
|
||||||
dec.DisallowUnknownFields()
|
dec.DisallowUnknownFields()
|
||||||
err = dec.Decode(paramPointer)
|
err = dec.Decode(paramPointer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return respondError(w, "", ErrInvalidParams, fmt.Errorf("Parsing Request: %w", err))
|
return respondError(w, req.ID, ErrInvalidParams, fmt.Errorf("Parsing Request: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
params := make([]reflect.Value, 3)
|
params := make([]reflect.Value, 3)
|
||||||
|
|
Loading…
Add table
Reference in a new issue