Merge branch '2.0.x'

This commit is contained in:
Stephane Nicoll
2018-10-01 10:50:58 -04:00
12 changed files with 41 additions and 47 deletions

View File

@@ -97,11 +97,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

@@ -109,13 +109,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);