changeset 1040:aac42dacb503

Stopped log spamming from OGC proxy and stopped leaking injected user names into log.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 24 Oct 2018 18:05:15 +0200
parents c576b5d59c58
children 7e3c620a5639
files pkg/controllers/proxy.go pkg/middleware/modifyquery.go
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/proxy.go	Wed Oct 24 16:43:43 2018 +0200
+++ b/pkg/controllers/proxy.go	Wed Oct 24 18:05:15 2018 +0200
@@ -53,7 +53,7 @@
 
 	return func(req *http.Request) {
 
-		log.Printf("proxyDirector: %s\n", req.RequestURI)
+		//log.Printf("proxyDirector: %s\n", req.RequestURI)
 
 		abort := func(format string, args ...interface{}) {
 			log.Printf(format, args...)
@@ -66,7 +66,7 @@
 
 		if entry, found := vars["entry"]; found {
 			if s, found = lookup(entry); !found {
-				abort("Cannot find entry '%s'\n", entry)
+				abort("warn: cannot find entry '%s'\n", entry)
 			}
 		} else {
 			expectedMAC, err := base64.URLEncoding.DecodeString(vars["hash"])
--- a/pkg/middleware/modifyquery.go	Wed Oct 24 16:43:43 2018 +0200
+++ b/pkg/middleware/modifyquery.go	Wed Oct 24 18:05:15 2018 +0200
@@ -95,7 +95,7 @@
 	parameters.Del("env")
 
 	if session, ok := auth.GetSession(req); ok {
-		log.Printf("Injecting user %s\n", session.User)
+		// log.Printf("info: injecting user %s\n", session.User)
 		parameters.Set("env", "user:"+hex.EncodeToString([]byte(session.User)))
 	}
 	return nil