Fix roundtripper doesn't increase request timeout setting after each retry (#1216)

This commit is contained in:
Ta-Ching Chen
2019-07-19 00:46:57 +08:00
committed by GitHub
parent 3bffd27c74
commit 6e00733f68
6 changed files with 147 additions and 122 deletions
+2 -2
View File
@@ -72,7 +72,7 @@ func LoggingMiddleware(logger *zap.Logger) func(next http.Handler) http.Handler
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
requestURI := r.RequestURI
if !strings.Contains(requestURI, "healthz") {
if !strings.HasSuffix(requestURI, "healthz") {
// Call the next handler, which can be another middleware in the chain, or the final handler.
handlers.CustomLoggingHandler(os.Stdout, next, func(writer io.Writer, params handlers.LogFormatterParams) {
host, _, err := net.SplitHostPort(params.Request.RemoteAddr)
@@ -81,7 +81,7 @@ func LoggingMiddleware(logger *zap.Logger) func(next http.Handler) http.Handler
host = params.Request.RemoteAddr
}
logger.Info("handled",
logger.Debug("handled",
zap.String("host", host),
zap.String("method", params.Request.Method),
zap.String("uri", params.Request.RequestURI),