Set status to 204 for notifications
This commit is contained in:
parent
e16edd5655
commit
401e5b481a
@ -165,7 +165,7 @@ describe('jsonrpc', () => {
|
|||||||
method: 'add',
|
method: 'add',
|
||||||
params: [1, 2],
|
params: [1, 2],
|
||||||
})
|
})
|
||||||
.expect(200)
|
.expect(204)
|
||||||
.expect('')
|
.expect('')
|
||||||
|
|
||||||
await request(createApp())
|
await request(createApp())
|
||||||
@ -176,7 +176,7 @@ describe('jsonrpc', () => {
|
|||||||
method: 'add',
|
method: 'add',
|
||||||
params: [1, 2],
|
params: [1, 2],
|
||||||
})
|
})
|
||||||
.expect(200)
|
.expect(204)
|
||||||
.expect('')
|
.expect('')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -141,7 +141,7 @@ export function jsonrpc<T, F extends FunctionPropertyNames<T>>(
|
|||||||
|
|
||||||
if (!isPromise(retValue)) {
|
if (!isPromise(retValue)) {
|
||||||
if (isNotification) {
|
if (isNotification) {
|
||||||
return res.send()
|
return res.status(204).send()
|
||||||
}
|
}
|
||||||
return res.json(createSuccessResponse(id, retValue))
|
return res.json(createSuccessResponse(id, retValue))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user