From ae4bc48481c7d097a15ce9c81d00655efdcd5a2c Mon Sep 17 00:00:00 2001 From: up-to-you Date: Wed, 7 Nov 2018 09:38:34 +0100 Subject: [PATCH] Fix stack-trace line breaks in whitelabel error views Since gh-12838, the WebFlux whitelabel error view also shows the stacktrace information if it is available in the model. This commit adds a CSS directive that preserves white spaces and breaks lines at newline characters. --- .../web/reactive/error/AbstractErrorWebExceptionHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java index b79c3219bc0..52e0fa002c7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java @@ -202,7 +202,7 @@ public abstract class AbstractErrorWebExceptionHandler builder.append("
").append(htmlEscape(message)).append("
"); } if (trace != null) { - builder.append("
").append(htmlEscape(trace)).append("
"); + builder.append("
").append(htmlEscape(trace)).append("
"); } builder.append(""); return responseBody.syncBody(builder.toString());