From e4f2d8a6c4388c98d349d6066052c7d61a3d5a2b Mon Sep 17 00:00:00 2001 From: Josh Horwitz Date: Sun, 12 Jul 2015 21:12:13 -0400 Subject: [PATCH] Fixed httpd logger to get user from query params --- CHANGELOG.md | 1 + services/httpd/response_logger.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8433adc8715..9c1e2ac5235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - [#3298](https://github.com/influxdb/influxdb/pull/3298): Corrected WAL & flush parameters in default config. Thanks @jhorwit2 - [#3152](https://github.com/influxdb/influxdb/issues/3159): High CPU Usage with unsorted writes - [#3307](https://github.com/influxdb/influxdb/pull/3307): Fix regression parsing boolean values True/False +- [#3304](https://github.com/influxdb/influxdb/pull/3304): Fixed httpd logger to log user from query params. Thanks @jhorwit2 ## v0.9.1 [2015-07-02] diff --git a/services/httpd/response_logger.go b/services/httpd/response_logger.go index 9382d885a06..03bcf30c337 100644 --- a/services/httpd/response_logger.go +++ b/services/httpd/response_logger.go @@ -120,6 +120,12 @@ func parseUsername(r *http.Request) string { } } + // Try to get the username from the query param 'u' + q := url.Query() + if u := q.Get("u"); u != "" { + username = u + } + // Try to get it from the authorization header if set there if username == "" { if u, _, ok := r.BasicAuth(); ok {