git.iko.soy/typeable/oauth2-proxy
on master help sign in
formatting and extra test

Can probably slim down the `ExcludePath` tests.

commit08021429eafd7241a8990597f1c8bcad8a424aee authorKarl Skewes <karl.skewes@gmail.com> dateMon 3 Jun 2019, 10:04 (7 years ago) parentc4f20ff
2 files changed+2
logging_handler_test.go+1 pkg/logger/logger.go+1
logging_handler_test.go+1
@@ -24,6 +24,7 @@ func TestLoggingHandler_ServeHTTP(t *testing.T) {
2424 {logger.DefaultRequestLoggingFormat, fmt.Sprintf("127.0.0.1 - - [%s] test-server GET - \"/foo/bar\" HTTP/1.1 \"\" 200 4 0.000\n", logger.FormatTimestamp(ts)), "/foo/bar", ""},
2525 {logger.DefaultRequestLoggingFormat, fmt.Sprintf("127.0.0.1 - - [%s] test-server GET - \"/foo/bar\" HTTP/1.1 \"\" 200 4 0.000\n", logger.FormatTimestamp(ts)), "/foo/bar", "/ping"},
2626 {logger.DefaultRequestLoggingFormat, fmt.Sprintf("127.0.0.1 - - [%s] test-server GET - \"/ping\" HTTP/1.1 \"\" 200 4 0.000\n", logger.FormatTimestamp(ts)), "/ping", ""},
27+ {logger.DefaultRequestLoggingFormat, "", "/ping", "/ping"},
2728 {"{{.RequestMethod}}", "GET\n", "/foo/bar", ""},
2829 {"{{.RequestMethod}}", "GET\n", "/foo/bar", "/ping"},
2930 {"{{.RequestMethod}}", "GET\n", "/ping", ""},
pkg/logger/logger.go+1
@@ -182,6 +182,7 @@ func (l *Logger) PrintReq(username, upstream string, req *http.Request, url url.
182182 if url.Path == l.excludePath {
183183 return
184184 }
185+
185186 duration := float64(time.Now().Sub(ts)) / float64(time.Second)
186187
187188 if username == "" {