Why filter chain is called twice for an asynchronous endpoint

后端 未结 2 1913
甜味超标
甜味超标 2021-02-10 23:35

I\'m developing a Spring boot based app. I noticed that for asynchronous endpoints authentication filter is called twice, for regular endpoints it\'s called once. I couldn\'t fi

2条回答
  •  猫巷女王i
    2021-02-11 00:04

    I had the same problem with a concrete implementation of the class AbstractAuthenticationProcessingFilter, I belive to solve it It's better create a custom implementation of whaterver class that implements OncePerRequestFilter, in my particular case I created an implementation of AuthenticationFilter.

提交回复
热议问题