fix: 适配 qBittorrent 5.2.0 WebAPI 返回 204 的变更#109
Merged
Conversation
qBittorrent 5.2.0 changelog: "WEBAPI: Send 204 when WebAPI response contains no data"。
登录与加种成功的响应不再是 200 + "Ok." 而是 204 No Content,原有的
res.body.indexOf("Ok") 与 statusCode !== 200 校验会把成功误判为失败,
导致下载器连接失败 (Issue vertex-app#108)。
- qb.js: 登录同时接受 204 与旧版 200 + "Ok." 两种成功形式,
并对 set-cookie 缺失情况加保护。
- Client.js: addTorrent / addTorrentByTorrentFile 的 statusCode 校验
追加 204 为成功。
其余仍返回 JSON 数据的端点 (getMaindata / getTrackerList 等) 不受 5.2.0
影响,未做修改;旧版 qBittorrent 行为保持兼容。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
qBittorrent 5.2.0 changelog: "WEBAPI: Send 204 when WebAPI response contains no data"。 登录与加种成功的响应不再是 200 + "Ok." 而是 204 No Content,原有的
res.body.indexOf("Ok") 与 statusCode !== 200 校验会把成功误判为失败, 导致下载器连接失败 (Issue #108)。
其余仍返回 JSON 数据的端点 (getMaindata / getTrackerList 等) 不受 5.2.0 影响,未做修改;旧版 qBittorrent 行为保持兼容。