Always return plain text from auth/login API endpoint#941
Merged
rogerfar merged 1 commit intorogerfar:mainfrom Mar 1, 2026
Merged
Always return plain text from auth/login API endpoint#941rogerfar merged 1 commit intorogerfar:mainfrom
auth/login API endpoint#941rogerfar merged 1 commit intorogerfar:mainfrom
Conversation
Contributor
Review Summary by QodoForce qB auth/login endpoint to return plain text
WalkthroughsDescription• Force /api/v2/auth/login to return plain text responses • Replace Ok() with Content() for explicit text/plain content type • Ensures compatibility with qBitController login validation • Prevents JSON serialization of login response strings Diagramflowchart LR
A["AuthLogin endpoint"] -->|"Changed from Ok()"| B["Content with text/plain"]
B -->|"Returns unquoted"| C["Ok. or Fails."]
C -->|"Compatible with"| D["qBitController"]
File Changes1. server/RdtClient.Web/Controllers/QBittorrentController.cs
|
Contributor
Code Review by Qodo
1. No regression test added
|
Closed
auth/login API endpoint
rogerfar
approved these changes
Mar 1, 2026
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.
Summary
Ok./Fails.)Accept-driven JSON serialization for this endpoint to match qBittorrent behaviorThis has the same behavior as the official qBittorrent API and removes an issue preventing to log in with qBitcontroller: fixes #872
Why
qBitController expects exact unquoted
Ok.from login. With JSON negotiation, ASP.NET can return"Ok.", which causes unknown login response errors.This was tested on my side and confirmed: the official qBittorrent implementation never returns a JSON string, always plain text, regardless of the
Acceptheader.Scope
Validation
POST /api/v2/auth/loginwithAccept: application/jsonshould still return plain textOk./Fails.(unquoted).