You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found some case that stacktrace is exposed when I use CookieLocaleResolver.
With inputting invalid value (e.g. ') in locale cookie, IllegalArgumentException is thrown and it is not handled any error handler.
As result, tomcat default stacktrace page is displayed.
Although I define Error Handling logic belows, it doesn't work for this situation.
declare class extending ExceptionHandlerExceptionResolver and add handler with @Exceptionhandler(Exception.class)
add server.error.whitelabel.enabled=false to avoid displaying whitelabel page
@IsaoTakahashi Thanks for the sample. This is indeed similar to #7936. Like that issue there's not much that we can do in Boot about this so I've opened SPR-15182 to see if CookieLocaleResolver can be made more robust. In the meantime, you can use the workaround described in that issue.
@wilkinsona Many thanks for handling!
Just now I've tried with 1.5.0.BUILD-SNAPSHOT and confirmed it is fixed.
(templates/error.html is responded to user)
I've found some case that stacktrace is exposed when I use
CookieLocaleResolver
.With inputting invalid value (e.g.
'
) in locale cookie,IllegalArgumentException
is thrown and it is not handled any error handler.As result, tomcat default stacktrace page is displayed.
Although I define Error Handling logic belows, it doesn't work for this situation.
ExceptionHandlerExceptionResolver
and add handler with@Exceptionhandler(Exception.class)
server.error.whitelabel.enabled=false
to avoid displaying whitelabel pageHere is a stacktrace on error page.
Related Issue
I think #7936 is similar situation.
Appendix
I created tiny demo app.
You can reproduce the issue with the app below.
IsaoTakahashi/cookie-locale-exception
The text was updated successfully, but these errors were encountered: