[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
parent 9813a044c0
commit 0d05bf473b
5 changed files with 197 additions and 4 deletions

View File

@ -62,8 +62,8 @@ func (p *processor) GetStatus(ctx context.Context, requestedUsername string, req
// get the status out of the database here
s := &gtsmodel.Status{}
if err := p.db.GetWhere(ctx, []db.Where{
{Key: "id", Value: requestedStatusID},
{Key: "account_id", Value: requestedAccount.ID},
{Key: "id", Value: requestedStatusID, CaseInsensitive: true},
{Key: "account_id", Value: requestedAccount.ID, CaseInsensitive: true},
}, s); err != nil {
return nil, gtserror.NewErrorNotFound(fmt.Errorf("database error getting status with id %s and account id %s: %s", requestedStatusID, requestedAccount.ID, err))
}