https://bz.apache.org/bugzilla/show_bug.cgi?id=63968

            Bug ID: 63968
           Summary: ExpiresFilter: invalid cast
           Product: Tomcat 8
           Version: 8.5.49
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: cp...@timocom.com
  Target Milestone: ----

The getExpirationDate() Method of the ExpiresFilter throws a ClassCastException
when the following conditions hold:
1. the request is ServletRequestWrapper
2. an inner request implements the interface
org.apache.catalina.servlet4preview.http.HttpServletRequest

Then the method will throw a ClassCastException in line 1296 of
org.apache.catalina.filters.ExpiresFilter.

Log Message observed:
Our application uses a custom implementation of a ServletRequestWrapper. The
ClassCastException logs that our custom implementation cannot be cast to
org.apache.catalina.servlet4preview.http.HttpServletRequest

Root Cause
==========
The root cause is that if-conditon in line 1295 checks that innerRequest is an
instance of servlet4preview.http.HttpServletRequest, yet in line 1296 the
request (rather than the innerRequest) is casted. 

Out Tomcat Settings:
====================
We use Tomcat 8.5.49 with Connector-Protocol
org.apache.coyote.http11.Http11NioProtocol.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to