mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 13:52:24 -06:00
[chore] chore rationalise http return codes for activitypub handlers (#2540)
* some small code fixups and changes * add check in ResolveIncomingActivity for transient activity types (i.e. activity ID is nil) * update test to handle new transient behaviour
This commit is contained in:
parent
906639ad7e
commit
67e11a1a61
5 changed files with 29 additions and 30 deletions
|
|
@ -143,10 +143,12 @@ func (f *federatingActor) PostInboxScheme(ctx context.Context, w http.ResponseWr
|
|||
have not yet applied authorization (ie., blocks).
|
||||
*/
|
||||
|
||||
// Obtain the activity; reject unknown activities.
|
||||
activity, errWithCode := ap.ResolveIncomingActivity(r)
|
||||
// Resolve the activity, rejecting badly formatted / transient.
|
||||
activity, ok, errWithCode := ap.ResolveIncomingActivity(r)
|
||||
if errWithCode != nil {
|
||||
return false, errWithCode
|
||||
} else if !ok { // transient
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// Set additional context data. Primarily this means
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue