mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-05-31 22:58:32 +00:00
move moving check to after error check
This commit is contained in:
parent
f7a336205d
commit
f899017b68
|
@ -117,12 +117,6 @@ func (m *Module) PublicTimelineGETHandler(c *gin.Context) {
|
|||
authed, err = oauth.Authed(c, false, false, false, false)
|
||||
} else {
|
||||
authed, err = oauth.Authed(c, true, true, true, true)
|
||||
if authed.Account.IsMoving() {
|
||||
// For moving/moved accounts, just return
|
||||
// empty to avoid breaking client apps.
|
||||
apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONArray)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
@ -130,6 +124,13 @@ func (m *Module) PublicTimelineGETHandler(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if authed.Account != nil && authed.Account.IsMoving() {
|
||||
// For moving/moved accounts, just return
|
||||
// empty to avoid breaking client apps.
|
||||
apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONArray)
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil {
|
||||
apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGetV1)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue