See gh-14621
This commit is contained in:
Johnny Lim
2018-09-27 15:46:13 +09:00
committed by Stephane Nicoll
parent da1fde6a5f
commit 1eca492c5e
12 changed files with 41 additions and 47 deletions

View File

@@ -84,11 +84,13 @@ public final class WebFluxTags {
return Tag.of("uri", pathPattern.getPatternString());
}
HttpStatus status = exchange.getResponse().getStatusCode();
if (status != null && status.is3xxRedirection()) {
return URI_REDIRECTION;
}
if (status != null && status.equals(HttpStatus.NOT_FOUND)) {
return URI_NOT_FOUND;
if (status != null) {
if (status.is3xxRedirection()) {
return URI_REDIRECTION;
}
if (status == HttpStatus.NOT_FOUND) {
return URI_NOT_FOUND;
}
}
String path = exchange.getRequest().getPath().value();
if (path.isEmpty()) {

View File

@@ -90,13 +90,15 @@ public final class WebMvcTags {
if (pattern != null) {
return Tag.of("uri", pattern);
}
else if (response != null) {
if (response != null) {
HttpStatus status = extractStatus(response);
if (status != null && status.is3xxRedirection()) {
return URI_REDIRECTION;
}
if (status != null && status.equals(HttpStatus.NOT_FOUND)) {
return URI_NOT_FOUND;
if (status != null) {
if (status.is3xxRedirection()) {
return URI_REDIRECTION;
}
if (status == HttpStatus.NOT_FOUND) {
return URI_NOT_FOUND;
}
}
}
String pathInfo = getPathInfo(request);