Commit c2913588 by Dave Syer

Add additional null check for uri

Fixes gh-803 (again)
parent 86d51528
......@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.HandlerMapping;
import com.google.common.collect.ImmutableMap;
......@@ -67,6 +68,9 @@ public class DefaultMetricsTagProvider implements MetricsTagProvider {
if (uri == null) {
uri = request.getPathInfo();
}
if (!StringUtils.hasText(uri)) {
uri = "/";
}
uri = sanitizeUrlTemplate(uri.substring(1));
tags.put("uri", uri.isEmpty() ? "root" : uri);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment