Skip to content

Commit

Permalink
get as throwable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Olav Eide committed Nov 11, 2024
1 parent c501285 commit 25a38df
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import jakarta.servlet.Filter
import jakarta.servlet.FilterChain
import jakarta.servlet.FilterConfig
import jakarta.servlet.RequestDispatcher.ERROR_EXCEPTION
import jakarta.servlet.RequestDispatcher.ERROR_MESSAGE
import jakarta.servlet.ServletRequest
import jakarta.servlet.ServletResponse
import jakarta.servlet.http.HttpServletRequest
Expand All @@ -21,7 +22,7 @@ open class JwtTokenValidationFilter(private val jwtTokenValidationHandler : JwtT

override fun doFilter(request : ServletRequest, response : ServletResponse, chain : FilterChain) {
if (request is HttpServletRequest) {
if (request.dispatcherType == ASYNC && (request.getAttribute(ERROR_EXCEPTION) as? String)?.contains("broken pipe", ignoreCase = true) == true) {
if (request.dispatcherType == ASYNC &&(request.getAttribute(ERROR_EXCEPTION) as? Throwable)?.message?.contains("broken pipe", ignoreCase = true) == true) {
log.trace("Skipping token validation for async request, client is gone")
chain.doFilter(request, response)
}
Expand Down

0 comments on commit 25a38df

Please sign in to comment.