Skip to content

Avatar endpoints return incorrect status code #28725

@lonix1

Description

@lonix1

Description

The API endpoints /user/avatar for creating/deleting an avatar has a single status code: 204. This is incorrect and doesn't work well with automation like ansible.

If the avatar is created successfully, then the endpoint should return 201 (Created). If no change was made then it should return something else. If there was an error it should return something else.

Same for the delete endpoint - it currently returns one status code.

Also note that the current behaviour (204) is different to the other endpoints.

Gitea Version

1.21.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies themtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions