Mercurial > gemma
comparison pkg/middleware/modifyquery.go @ 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 | a244b18cb916 |
children | 04967d6565fa |
comparison
equal
deleted
inserted
replaced
1039:c576b5d59c58 | 1040:aac42dacb503 |
---|---|
93 func InjectUser(req *http.Request, parameters url.Values) error { | 93 func InjectUser(req *http.Request, parameters url.Values) error { |
94 // To prevent SQL injections | 94 // To prevent SQL injections |
95 parameters.Del("env") | 95 parameters.Del("env") |
96 | 96 |
97 if session, ok := auth.GetSession(req); ok { | 97 if session, ok := auth.GetSession(req); ok { |
98 log.Printf("Injecting user %s\n", session.User) | 98 // log.Printf("info: injecting user %s\n", session.User) |
99 parameters.Set("env", "user:"+hex.EncodeToString([]byte(session.User))) | 99 parameters.Set("env", "user:"+hex.EncodeToString([]byte(session.User))) |
100 } | 100 } |
101 return nil | 101 return nil |
102 } | 102 } |