socket-controllers
socket-controllers copied to clipboard
NamespaceParam(s) accepts only numeric values
Hi, I discovered that NspParam(s) decorators crash if param is string.
I checked the source code and I think it's most likely caused by one row in SocketControllerExecutor.ts.
In function parseParamValue:
const parseValue = typeof value === "string" ? JSON.parse(value) : value;
should be instead
const parseValue = typeof value !== "string" ? JSON.parse(value) : value;
Puill request: https://github.com/typestack/socket-controllers/pull/29
The proposed solution is invalid. That way the received payload would never be parsed as JSON even if it's a JSON string.
Should be fixed in the latest release
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.