Skip to content

Custom command with json body gets sent incorrectly #993

@SvenFinn

Description

@SvenFinn

Iris version

3.70.0

Operating system(s) affected

  • Windows
  • MacOS
  • iOS
  • Android
  • Linux
  • Other

Browser(s) affected

  • Firefox
  • Chrome
  • Edge
  • Other

What happened?

I tried creating a custom command, that talks to mopidy itself to clear the tracklist.

I did this by telling iris to send a request to http://localhost:6680/mopidy/rpc with the headers content-type: application/json and the following body:
{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.clear"}

When trying this command, iris sends the following body instead:
"{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"core.tracklist.clear\"}"

This seems like iris is sserializing the string, instead of directly passing it to the request. This could be because of these lines in core.py.
As a temporary fix, I've removed these lines in my mopidy instance, which seems to fix the issue

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions