Skip to content

Commit

Permalink
fix(scaffolod): can not resolve error page on accept text/html
Browse files Browse the repository at this point in the history
  • Loading branch information
taccisum committed Aug 29, 2019
1 parent 1443daa commit eb8d233
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public ApplicationErrorAttributes(ServerProperties serverProperties) {
public Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
Map<String, Object> attributes = super.getErrorAttributes(webRequest, includeStackTrace);

if (webRequest.getHeader("Accept").matches(".*text/html.*")) {
return attributes;
}

Map<String, Object> resultAttributes = new LinkedHashMap<>();
resultAttributes.put("success", false);
resultAttributes.put("message", attributes.get("message"));
Expand Down

0 comments on commit eb8d233

Please sign in to comment.