{"action":"created","issue":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/8554","repository_url":"https://api.github.com/repos/qbittorrent/qBittorrent","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/8554/labels{/name}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/8554/comments","events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/8554/events","html_url":"https://github.com/qbittorrent/qBittorrent/issues/8554","id":302884783,"number":8554,"title":"API v2 calls doesn't work (at least few)","user":{"login":"Kolcha","id":947647,"avatar_url":"https://avatars0.githubusercontent.com/u/947647?v=4","gravatar_id":"","url":"https://api.github.com/users/Kolcha","html_url":"https://github.com/Kolcha","followers_url":"https://api.github.com/users/Kolcha/followers","following_url":"https://api.github.com/users/Kolcha/following{/other_user}","gists_url":"https://api.github.com/users/Kolcha/gists{/gist_id}","starred_url":"https://api.github.com/users/Kolcha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kolcha/subscriptions","organizations_url":"https://api.github.com/users/Kolcha/orgs","repos_url":"https://api.github.com/users/Kolcha/repos","events_url":"https://api.github.com/users/Kolcha/events{/privacy}","received_events_url":"https://api.github.com/users/Kolcha/received_events","type":"User","site_admin":false},"labels":[{"id":517749422,"url":"https://api.github.com/repos/qbittorrent/qBittorrent/labels/Not%20an%20issue","name":"Not an issue","color":"3cff5c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-06T22:03:21Z","updated_at":"2018-03-07T09:19:52Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### qBittorrent version and Operating System\r\nqbittorrent-nox, master branch, commit c759c4301e5a19f641c92ebe703df4801ac56903\r\n\r\n### If on linux, libtorrent and Qt version\r\nlibtorrent 1.1.x , RC_1_1 branch, commit f052480e3f27424fdad99de053ef88a3fd8a433f\r\nQt 5.12.0, dev branch\r\n\r\n### What is the problem\r\nnew v2 API call with arguments doesn't work, error 404 returned\r\n\r\n### What is the expected behavior\r\nAPI calls work correctly\r\n\r\n### Steps to reproduce\r\n1. get torrents list:\r\n```\r\ncurl http://localhost:8080/api/v2/torrents/info\r\n```\r\n2. choose some torrent hash and ask for its files:\r\n```\r\ncurl http://localhost:8080/api/v2/torrents/files/5db68cd406437ae20a671da18ceda27e485a6d4a -v\r\n```\r\n```\r\n*   Trying ::1...\r\n* TCP_NODELAY set\r\n* Connected to localhost (::1) port 8080 (#0)\r\n> GET /api/v2/torrents/files/5db68cd406437ae20a671da18ceda27e485a6d4a HTTP/1.1\r\n> Host: localhost:8080\r\n> User-Agent: curl/7.55.1\r\n> Accept: */*\r\n> \r\n< HTTP/1.1 404 Not Found\r\n< connection: keep-alive\r\n< content-length: 0\r\n< content-security-policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none';\r\n< date: Tue, 06 Mar 2018 22:04:39 GMT\r\n< set-cookie: SID=wpkRBeF6tYNbtQxMceEFi83wq5VrVL69; HttpOnly; path=/\r\n< x-content-type-options: nosniff\r\n< x-frame-options: SAMEORIGIN\r\n< x-xss-protection: 1; mode=block\r\n< \r\n* Connection #0 to host localhost left intact\r\n```\r\n### Extra info\r\nold API (i.e. `curl http://localhost:8080/query/propertiesFiles/5db68cd406437ae20a671da18ceda27e485a6d4a` works fine.\r\nI added some \"printfs\" into `findAPICall` and `findLegacyAPICall` and got next output:\r\n```\r\n******** Information ********\r\nTo control qBittorrent, access the Web UI at http://localhost:8080\r\nThe Web UI administrator user name is: nick\r\n\"/api/v2/torrents/info\" is v2 API call\r\nscope:  \"torrents\"\r\naction:  \"info\"\r\nparams:  QMap()\r\n\"/query/torrents\" not matched as v2 API!\r\n\"/query/torrents\" is legacy API call\r\nscope:  \"torrents\"\r\naction:  \"info\"\r\nparams:  QMap()\r\n\"/query/propertiesFiles/5db68cd406437ae20a671da18ceda27e485a6d4a\" not matched as v2 API!\r\n\"/query/propertiesFiles/5db68cd406437ae20a671da18ceda27e485a6d4a\" is legacy API call\r\nscope:  \"torrents\"\r\naction:  \"files\"\r\nparams:  QMap((\"hash\", \"5db68cd406437ae20a671da18ceda27e485a6d4a\"))\r\n\"/api/v2/torrents/files/5db68cd406437ae20a671da18ceda27e485a6d4a\" not matched as v2 API!\r\n\"/api/v2/torrents/files/5db68cd406437ae20a671da18ceda27e485a6d4a\" not matched as legacy API\r\nscope:  \"\"\r\naction:  \"\"\r\n```\r\nas you can see, API call `/torrents/files/<hash>` even not matched as API call... Same things will happen with any other call which has an argument.\r\nsomething is wrong with regular expression, unfortunately I can't fix it, sorry. I'm not so good in regex, I know only few very basic things."},"comment":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/comments/371075176","html_url":"https://github.com/qbittorrent/qBittorrent/issues/8554#issuecomment-371075176","issue_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/8554","id":371075176,"user":{"login":"glassez","id":5063477,"avatar_url":"https://avatars3.githubusercontent.com/u/5063477?v=4","gravatar_id":"","url":"https://api.github.com/users/glassez","html_url":"https://github.com/glassez","followers_url":"https://api.github.com/users/glassez/followers","following_url":"https://api.github.com/users/glassez/following{/other_user}","gists_url":"https://api.github.com/users/glassez/gists{/gist_id}","starred_url":"https://api.github.com/users/glassez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glassez/subscriptions","organizations_url":"https://api.github.com/users/glassez/orgs","repos_url":"https://api.github.com/users/glassez/repos","events_url":"https://api.github.com/users/glassez/events{/privacy}","received_events_url":"https://api.github.com/users/glassez/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T09:19:52Z","updated_at":"2018-03-07T09:19:52Z","author_association":"MEMBER","body":"You can't use `/torrents/files/<hash>`. APIv2 doesn't allow any params in path, only as GET or POST params.\r\n\r\nP.S. the API wiki page is currently under development."}}
{"actor":{"display_login":"glassez"}}