Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/command/setState crashes Adapter, when state contains an url encoded '%' sign #84

Open
nokxs opened this issue Feb 16, 2024 · 0 comments
Labels

Comments

@nokxs
Copy link

nokxs commented Feb 16, 2024

Describe the bug
When setting the value of a state with the GET command /command/setState and the value contains an url encoded '%' sign (%25), then the whole adapter crashes.

To Reproduce
Execute curl -X 'GET' 'http://iobroker.lan:8093/v1/command/setState?id=0_userdata.0.test&state=100%25' -H 'accept: application/json'

Expected behavior
The value of the state 0_userdata.0.test contains 100%

Screenshots & Logfiles
Exception in ioBroker log:

rest-api.0 | 2024-02-16 14:02:42.530 | error | URI malformed
rest-api.0 | 2024-02-16 14:02:42.530 | error | URIError: URI malformed at decodeURIComponent (<anonymous>) at parseQuery (/opt/iobroker/node_modules/iobroker.rest-api/lib/rest-api.js:57:73) at /opt/iobroker/node_modules/iobroker.rest-api/lib/rest-api.js:838:26 at Layer.handle [as handle_request] (/opt/iobroker/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/opt/iobroker/node_modules/express/lib/router/index.js:328:13) at /opt/iobroker/node_modules/express/lib/router/index.js:286:9 at param (/opt/iobroker/node_modules/express/lib/router/index.js:365:14) at param (/opt/iobroker/node_modules/express/lib/router/index.js:376:14) at Function.process_params (/opt/iobroker/node_modules/express/lib/router/index.js:421:3) at next (/opt/iobroker/node_modules/express/lib/router/index.js:280:10)
rest-api.0 | 2024-02-16 14:02:42.529 | error | unhandled promise rejection: URI malformed
rest-api.0 | 2024-02-16 14:02:42.529 | error | Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().

Versions:

  • Adapter version: 1.1.0
  • JS-Controller version: 4.0.24
  • Node version: 18.17.1
  • Operating system: docker
@Apollon77 Apollon77 added the bug label Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants