Skip to content

Commit

Permalink
It is expected to return 404 instead of a null root hash
Browse files Browse the repository at this point in the history
Fixes: #270
  • Loading branch information
nemunaire committed Mar 20, 2024
1 parent 783da33 commit 98c7da8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/app/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,7 @@ func (app *App) syncGetRootV3(c *gin.Context) {
reader, generation, _, err := app.blobStorer.LoadBlob(uid, "root")
if err == fs.ErrorNotFound {
log.Warn("No root file found, assuming this is a new account")
c.JSON(http.StatusOK, messages.SyncRootV3{
Generation: 0,
})
c.JSON(http.StatusNotFound, gin.H{"message": "root not found"})
return
} else if err != nil {
log.Error(err)
Expand Down

0 comments on commit 98c7da8

Please sign in to comment.