Submitting non file avatar to post avatar endpoint returns 500
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Bug Report
Current Behavior
If you send a POST request to the /api/users/{id}/avatar with a non file avatar attribute, a server error is produced and 500 status code is returned.
Expected Behavior
A validation exception should be thrown and a proper status code returned.
Environment
- Flarum version: 1.1-dev
Additional Context
Integration tests must be added for the avatar endpoint.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the POST /api/users/{id}/avatar endpoint and read how it handles the avatar attribute when the value is not a file. Add integration coverage for this request, and consider the issue complete when it raises a validation exception and returns the proper status code instead of 500.
Written by the indexing model from the issue text.
Assessment
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100