Ensure status in ErrorPageFilter defaults to 200
Fixes gh-1369. Note that this is caused by the ErrorPageFilter, so only a problem when deployed as a WAR.
This commit is contained in:
@@ -93,10 +93,17 @@ public class MetricFilterAutoConfiguration {
|
||||
int status = getStatus(response);
|
||||
Object bestMatchingPattern = request
|
||||
.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);
|
||||
HttpStatus httpStatus = HttpStatus.OK;
|
||||
try {
|
||||
httpStatus = HttpStatus.valueOf(status);
|
||||
}
|
||||
catch (Exception e) {
|
||||
// not convertible
|
||||
}
|
||||
if (bestMatchingPattern != null) {
|
||||
suffix = bestMatchingPattern.toString().replaceAll("[{}]", "-");
|
||||
}
|
||||
else if (HttpStatus.valueOf(status).is4xxClientError()) {
|
||||
else if (httpStatus.is4xxClientError()) {
|
||||
suffix = UNKNOWN_PATH_SUFFIX;
|
||||
}
|
||||
String gaugeKey = getKey("response" + suffix);
|
||||
|
||||
Reference in New Issue
Block a user