mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 21:02:26 -05:00
Unblock fix (#247)
* start tests for inbox posts * go mod tidy * rename transferContext * test block/unblock * improve logging * improve logging * fix comment typo
This commit is contained in:
parent
d515c9f1ec
commit
c7cfbe2702
16 changed files with 362 additions and 29 deletions
|
|
@ -40,12 +40,12 @@ func (m *Module) InboxPOSTHandler(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
ctx := populateContext(c)
|
||||
ctx := transferContext(c)
|
||||
|
||||
posted, err := m.processor.InboxPost(ctx, c.Writer, c.Request)
|
||||
if err != nil {
|
||||
if withCode, ok := err.(gtserror.WithCode); ok {
|
||||
l.Debug(withCode.Error())
|
||||
l.Debugf("InboxPOSTHandler: %s", withCode.Error())
|
||||
c.JSON(withCode.Code(), withCode.Safe())
|
||||
return
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ func (m *Module) InboxPOSTHandler(c *gin.Context) {
|
|||
}
|
||||
|
||||
if !posted {
|
||||
l.Debugf("request could not be handled as an AP request; headers were: %+v", c.Request.Header)
|
||||
l.Debugf("InboxPOSTHandler: request could not be handled as an AP request; headers were: %+v", c.Request.Header)
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "unable to process request"})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue