alibaba / jvm-sandbox-repeater

A Java server-side recording and playback solution based on JVM-Sandbox
Apache License 2.0
2.53k stars 702 forks source link

filter 里面的java mock方法无法被感知 #231

Open laihongying966 opened 2 months ago

laihongying966 commented 2 months ago

因为 HttpServlet 在 filter之后,里面的代码没有办法被感知,我尝试在 HttpPlugin 里面 拦截 javax.servlet.Filter.doFilter 但是没有什么用,我还需要改一些其他的东西吗

Aresxue commented 1 month ago

复用HttpStandaloneListener的同时把插桩点改到org.springframework.web.filter.CharacterEncodingFilter#doFilterInternal去就可以了,因为入参是javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain所以基本上没有其它修改