From 5f5994726ef2bb3723ab756125db7341bcfc2ee9 Mon Sep 17 00:00:00 2001 From: Azareal Date: Wed, 10 Jan 2018 04:35:34 +0000 Subject: [PATCH] Fixed a text editor bug. It should log the unknown user agents properly now... --- common/parser.go | 1 + gen_router.go | 2 +- router_gen/main.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/parser.go b/common/parser.go index 0453a810..ad053d65 100644 --- a/common/parser.go +++ b/common/parser.go @@ -177,6 +177,7 @@ func PreparseMessage(msg string) string { msg = RunSshook("preparse_preassign", msg) } msg = html.EscapeString(msg) + msg = strings.Replace(msg," ","",-1) var runes = []rune(msg) msg = "" diff --git a/gen_router.go b/gen_router.go index 307b6e21..d888058f 100644 --- a/gen_router.go +++ b/gen_router.go @@ -371,7 +371,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { default: common.AgentViewCounter.Bump(0) if common.Dev.DebugMode { - log.Print("Unknown UA: ", ua) + log.Print("Unknown UA: ", req.UserAgent()) } } diff --git a/router_gen/main.go b/router_gen/main.go index 0ac9818c..45f8d96e 100644 --- a/router_gen/main.go +++ b/router_gen/main.go @@ -334,7 +334,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { default: common.AgentViewCounter.Bump({{.AllAgentMap.unknown}}) if common.Dev.DebugMode { - log.Print("Unknown UA: ", ua) + log.Print("Unknown UA: ", req.UserAgent()) } }