Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting nonexistent user email via API causes internal server error #15357

Closed
1 of 6 tasks
matusf opened this issue Apr 9, 2021 · 0 comments · Fixed by #15383
Closed
1 of 6 tasks

Deleting nonexistent user email via API causes internal server error #15357

matusf opened this issue Apr 9, 2021 · 0 comments · Fixed by #15383
Labels
modifies/api This PR adds API routes or modifies them type/bug

Comments

@matusf
Copy link

matusf commented Apr 9, 2021

  • Gitea version (or commit ref): Gitea version 1.13.7 built with GNU Make 4.1, go1.15.11 : bindata, sqlite, sqlite_unlock_notify
  • Git version: git version 2.17.
  • Operating system: Ubuntu 18.04
  • Downloaded gitea from downloads page
  • Running as a command-line program
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
2021/04/09 01:45:57 Started DELETE /api/v1/user/emails for 127.0.0.1
2021/04/09 01:45:57 ...api/v1/user/email.go:128:DeleteEmail() [E] DeleteEmailAddresses: Email address does not exist
2021/04/09 01:45:57 Completed DELETE /api/v1/user/emails 500 Internal Server Error in 50.684576ms

Description

Make a DELETE request on /user/emails endpoint with supplied authorization token and invalid email in the body. Then 500 response is returned with following response body:

curl -v -X DELETE -H "Authorization: token $TOKEN" -d '{"emails":["xxx",""]}' 'http://localhost:2999/api/v1/user/emails' -H "Content-Type: application/json"
{"message":"","url":"http://localhost:3000/api/swagger"}
@6543 6543 added the modifies/api This PR adds API routes or modifies them label Apr 9, 2021
a1012112796 added a commit to a1012112796/gitea that referenced this issue Apr 10, 2021
fix go-gitea#15357

Signed-off-by: a1012112796 <1012112796@qq.com>
zeripath pushed a commit that referenced this issue Apr 10, 2021
fix #15357

Signed-off-by: a1012112796 <1012112796@qq.com>
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
fix go-gitea#15357

Signed-off-by: a1012112796 <1012112796@qq.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants