Skip to content

Commit 8a7e839

Browse files
committed
Polishing
1 parent 4b18cc9 commit 8a7e839

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/function/server/DefaultRenderingResponseBuilder.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,10 @@ protected Mono<Void> writeToInternal(ServerWebExchange exchange, Context context
205205
}
206206

207207
private void setStatus(View view) {
208-
if (view instanceof RedirectView) {
209-
HttpStatus httpStatus = HttpStatus.resolve(rawStatusCode());
210-
if (httpStatus != null && httpStatus.is3xxRedirection()) {
211-
RedirectView redirectView = (RedirectView) view;
212-
redirectView.setStatusCode(httpStatus);
208+
if (view instanceof RedirectView redirectView) {
209+
HttpStatusCode statusCode = statusCode();
210+
if (statusCode.is3xxRedirection()) {
211+
redirectView.setStatusCode(statusCode);
213212
}
214213
}
215214
}

0 commit comments

Comments
 (0)