You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a space in a query parameter is encoded with a + (plus sign) in a GET request, qBittorrent interprets the plus sign as part of the query parameter value. It appears that query parameters must be percent encoded. Based on what I've read, that makes sense since the plus sign was never actually part of the URL spec. That aside, it definitely happens. Spaces encoded as plus signs in the body of POST (application/x-www-form-urlencoded) requests are interpreted correctly. (Although, the internet suggests this is where the plus sign encoding in URLs came from...)
Case in point, I've been implementing an API client in Python and the requests module will encode spaces in query parameters as plus signs.
I did find the workaround below to ensure query parameters are percent encoded....a bit wonky though.
Endpoints most likely to be affected:
torrents/info
search/categories
The text was updated successfully, but these errors were encountered:
rmartin16
changed the title
WebUI API: Only Percent Encoded Spaces are Respected in Query Parameters
WebUI API: Spaces Encoded as Plus Signs (ie + ) in Query Parameters Are Not Interpreted as Spaces and Instead Become Part of the Parameter
May 9, 2019
Chocobo1
added a commit
to Chocobo1/qBittorrent
that referenced
this issue
May 9, 2019
qBittorrent version and Operating System
qBittorrent 4.1.5
Linux (Ubuntu)
If on linux, libtorrent and Qt version
libtorrent 1.1.13.0
Qt 5.12.2
What is the problem
When a space in a query parameter is encoded with a + (plus sign) in a GET request, qBittorrent interprets the plus sign as part of the query parameter value. It appears that query parameters must be percent encoded. Based on what I've read, that makes sense since the plus sign was never actually part of the URL spec. That aside, it definitely happens. Spaces encoded as plus signs in the body of POST (application/x-www-form-urlencoded) requests are interpreted correctly. (Although, the internet suggests this is where the plus sign encoding in URLs came from...)
Case in point, I've been implementing an API client in Python and the requests module will encode spaces in query parameters as plus signs.
I did find the workaround below to ensure query parameters are percent encoded....a bit wonky though.
That said, a POST requests also works around this problem.
What is the expected behavior
Interpret '+' symbols in the query parameters as spaces and %2B as plus signs.
Steps to reproduce
Make the query below:
http://localhost:8080/api/v2/torrents/info?category=delete+after+upload
Extra info(if any)
Endpoints most likely to be affected:
torrents/info
search/categories
The text was updated successfully, but these errors were encountered: