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)
|
authed, err = oauth.Authed(c, false, false, false, false)
|
||||||
} else {
|
} else {
|
||||||
authed, err = oauth.Authed(c, true, true, true, true)
|
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 {
|
if err != nil {
|
||||||
|
@ -130,6 +124,13 @@ func (m *Module) PublicTimelineGETHandler(c *gin.Context) {
|
||||||
return
|
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 {
|
if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil {
|
||||||
apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGetV1)
|
apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGetV1)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue