diff options
Diffstat (limited to 'internal/api/client/media/mediacreate.go')
-rw-r--r-- | internal/api/client/media/mediacreate.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/api/client/media/mediacreate.go b/internal/api/client/media/mediacreate.go index f808b554c..47f63561b 100644 --- a/internal/api/client/media/mediacreate.go +++ b/internal/api/client/media/mediacreate.go @@ -27,6 +27,7 @@ import ( "github.com/spf13/viper" "github.com/gin-gonic/gin" + "github.com/superseriousbusiness/gotosocial/internal/api" "github.com/superseriousbusiness/gotosocial/internal/api/model" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/oauth" @@ -93,6 +94,11 @@ func (m *Module) MediaCreatePOSTHandler(c *gin.Context) { return } + if _, err := api.NegotiateAccept(c, api.JSONAcceptHeaders...); err != nil { + c.JSON(http.StatusNotAcceptable, gin.H{"error": err.Error()}) + return + } + // extract the media create form from the request context l.Tracef("parsing request form: %s", c.Request.Form) form := &model.AttachmentRequest{} |