use fallback if not x-forwarded-for is present
This commit is contained in:
3
main.go
3
main.go
@@ -1105,10 +1105,9 @@ func main() {
|
||||
go housekeeping()
|
||||
|
||||
r := gin.New()
|
||||
|
||||
r.Use(gin.LoggerWithFormatter(func(param gin.LogFormatterParams) string {
|
||||
return fmt.Sprintf("%s - \"%s %s %s %d %s \"%s\" %s\"\n",
|
||||
param.Request.Header.Get("X-Forwarded-For"),
|
||||
utils.RealIP(¶m.Request.Header, param.Request.RemoteAddr),
|
||||
param.Method,
|
||||
param.Path,
|
||||
param.Request.Proto,
|
||||
|
Reference in New Issue
Block a user