From 4bb6950e34e214bde78bc106e92fe303474a0601 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Sun, 11 Feb 2018 22:40:39 +0100 Subject: [PATCH] Set content type of api requests to application/json --- router/router.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/router/router.go b/router/router.go index c45f7a2..71418fc 100644 --- a/router/router.go +++ b/router/router.go @@ -25,6 +25,10 @@ func Create(db *database.GormDatabase) (*gin.Engine, func()) { g.GET("/") + g.Use(func(ctx *gin.Context) { + ctx.Header("Content-Type", "application/json") + }) + g.Group("/").Use(authentication.RequireApplicationToken()).POST("/message", messageHandler.CreateMessage) clientAuth := g.Group("")