#3521: Content-type's charset should be accepted and probably ignored for
jsonrpc
communication
----------------------------+---------------------
Reporter: ibizaman | Type: bug
Status: new | Priority: minor
Milestone: needs verified | Component: Unknown
Version: 2.0.0 | Keywords:
----------------------------+---------------------
Sending a request with {{{'Content-Type: application/json'}}} works fine:
{{{#!sh
$ curl 'http://127.0.0.1:8112/json' -X POST \
-H 'Content-Type: application/json' \
--data-raw '{"method":"daemon.get_version","params":[],"id":1}'
{ "result": null
, "error": { "message": "Not authenticated"
, "code": 1
}
, "id": 1}
}}}
But it should work too with {{{'Content-Type:
application/json;charset=utf-8'}}} although it doesn't:
{{{#!sh
$ curl 'http://127.0.0.1:8112/json' -X POST \
-H 'Content-Type: application/json;charset=utf-8' \
--data-raw '{"method":"daemon.get_version","params":[],"id":1}'
{ "result": null
, "id": null
, "error": { "code": 5
, "message": "JSONException: Invalid JSON request content-type:
application/json;charset=utf-8"
}
}
This is a valid content-type as per
https://greenbytes.de/tech/webdav/rfc2616.html#header.content-type
I believe I know how to fix this and will create a PR for it.
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3521>
Deluge <https://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups
"Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/deluge-dev/047.22b5a974e534ccd72d538d701618230a%40deluge-torrent.org.