flarum / flarum/issue-archive

Submitting non file avatar to post avatar endpoint returns 500

Open
#42 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.