Commit ae4bc484 authored by up-to-you's avatar up-to-you Committed by Brian Clozel

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.
parent 27d1af8f
...@@ -202,7 +202,7 @@ public abstract class AbstractErrorWebExceptionHandler ...@@ -202,7 +202,7 @@ public abstract class AbstractErrorWebExceptionHandler
builder.append("<div>").append(htmlEscape(message)).append("</div>"); builder.append("<div>").append(htmlEscape(message)).append("</div>");
} }
if (trace != null) { if (trace != null) {
builder.append("<div>").append(htmlEscape(trace)).append("</div>"); builder.append("<div style='white-space:pre-wrap;'>").append(htmlEscape(trace)).append("</div>");
} }
builder.append("</body></html>"); builder.append("</body></html>");
return responseBody.syncBody(builder.toString()); return responseBody.syncBody(builder.toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment