Change Request.Header.Get to GetHeader function (#290)

* Change Request.Header.Get to GetHeader function

* update gin version

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update gin version

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update gin version

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
JieJhih
2017-10-03 08:21:49 -05:00
committed by Bo-Yi Wu
parent df987d5e53
commit 01d545a408
33 changed files with 1559 additions and 703 deletions

View File

@@ -274,7 +274,7 @@ func LogPush(status, token string, req PushNotification, errPush error) {
// LogMiddleware provide gin router handler.
func LogMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
LogRequest(c.Request.URL.Path, c.Request.Method, c.ClientIP(), c.ContentType(), c.Request.Header.Get("User-Agent"))
LogRequest(c.Request.URL.Path, c.Request.Method, c.ClientIP(), c.ContentType(), c.GetHeader("User-Agent"))
c.Next()
}
}