[bug] Fix status API / status web API being case sensitive (#481)

* make getStatus by id case-insensitive

* test get status case insensitive

* init config before log
This commit is contained in:
tobi 2022-04-24 14:24:43 +02:00 committed by GitHub
commit 0d05bf473b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 197 additions and 4 deletions

View file

@ -70,7 +70,7 @@ func (s *statusDB) GetStatusByID(ctx context.Context, id string) (*gtsmodel.Stat
return s.cache.GetByID(id)
},
func(status *gtsmodel.Status) error {
return s.newStatusQ(status).Where("status.id = ?", id).Scan(ctx)
return s.newStatusQ(status).Where("LOWER(status.id) = LOWER(?)", id).Scan(ctx)
},
)
}