mirror of
https://github.com/gotson/komga.git
synced 2025-12-21 07:56:57 +01:00
bug fix: prevent circular loop in the error resolver, which would complain in logs
This commit is contained in:
parent
e1d80e505a
commit
0be3bb4b84
1 changed files with 5 additions and 5 deletions
|
|
@ -9,10 +9,10 @@ import javax.servlet.http.HttpServletRequest
|
|||
|
||||
@Component
|
||||
class SPAErrorViewResolver : ErrorViewResolver {
|
||||
override fun resolveErrorView(request: HttpServletRequest, status: HttpStatus, model: MutableMap<String, Any>): ModelAndView =
|
||||
if (status == HttpStatus.NOT_FOUND) {
|
||||
ModelAndView("/", HttpStatus.TEMPORARY_REDIRECT)
|
||||
} else {
|
||||
ModelAndView("/error", status)
|
||||
override fun resolveErrorView(request: HttpServletRequest, status: HttpStatus, model: MutableMap<String, Any>): ModelAndView? =
|
||||
when {
|
||||
request.requestURL.toString() == "/error" -> null
|
||||
status == HttpStatus.NOT_FOUND -> ModelAndView("/", HttpStatus.TEMPORARY_REDIRECT)
|
||||
else -> ModelAndView("/error", status)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue