socket-controllers icon indicating copy to clipboard operation
socket-controllers copied to clipboard

NamespaceParam(s) accepts only numeric values

Open Kalhama opened this issue 5 years ago • 2 comments
trafficstars

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;

Kalhama avatar Mar 05 '20 12:03 Kalhama

Puill request: https://github.com/typestack/socket-controllers/pull/29

Kalhama avatar Mar 05 '20 12:03 Kalhama

The proposed solution is invalid. That way the received payload would never be parsed as JSON even if it's a JSON string.

NoNameProvided avatar Aug 02 '20 16:08 NoNameProvided

Should be fixed in the latest release

attilaorosz avatar Jan 20 '23 19:01 attilaorosz

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.

github-actions[bot] avatar Feb 20 '23 01:02 github-actions[bot]