Reject NUL characters in the Lidarr root folder with a 400 - #217
Merged
Merged
Conversation
Member
Author
|
APPROVE at head 240e8d4. Checked out the head (origin/main is an ancestor, stacked on #216). CI at this head when I looked: CodeFactor and ghostdeps succeeded, "Verify TypeScript workspace" was still in progress, so not CI-green yet. Same-account review. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Same class as #215 and #216. rootFolderPath from POST /api/v1/settings/lidarr is stored in Postgres, which cannot hold NUL, so a payload containing \u0000 passed validation, contacted the Lidarr server, and then failed in the upsert with a 500. The schema now refuses NUL, so the request gets the existing 400 INVALID_REQUEST before any network call or query. Test: on main the request is not rejected with 400 and reaches the network call; with the change it answers 400 and neither fetch nor the database is touched. This route had no api test before. Behaviour change: invalid payload returns 400 instead of 500.