diff options
Diffstat (limited to 'internal/api/client/media/mediaget.go')
-rw-r--r-- | internal/api/client/media/mediaget.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/api/client/media/mediaget.go b/internal/api/client/media/mediaget.go index 0ddccc4e4..42af19000 100644 --- a/internal/api/client/media/mediaget.go +++ b/internal/api/client/media/mediaget.go @@ -19,10 +19,12 @@ package media import ( - "github.com/sirupsen/logrus" "net/http" + "github.com/sirupsen/logrus" + "github.com/gin-gonic/gin" + "github.com/superseriousbusiness/gotosocial/internal/api" "github.com/superseriousbusiness/gotosocial/internal/oauth" ) @@ -70,6 +72,11 @@ func (m *Module) MediaGETHandler(c *gin.Context) { return } + if _, err := api.NegotiateAccept(c, api.JSONAcceptHeaders...); err != nil { + c.JSON(http.StatusNotAcceptable, gin.H{"error": err.Error()}) + return + } + attachmentID := c.Param(IDKey) if attachmentID == "" { c.JSON(http.StatusBadRequest, gin.H{"error": "no attachment ID given in request"}) |