Multiple executions in ClientHttpRequestInterceptor cause next interceptors in chain not being called #32525
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
Affects: 6.1.3
In a couple of
ClientHttpRequestInterceptor
I made I needed to potentially execute given request more than once. Examples:RetryInterceptor
: if some errors are raised making the call, retry again N timesOAuthInterceptor
: aside from refreshing token on expiration time, when a 401 is received I want to refresh token and execute again the same callThey are working correctly, but the problem is that any interceptors registered after these ones are only called on first execution. This is due to
InterceptingClientHttpRequest.InterceptingRequestExecution
:So, the second time I call
execution.execute()
, this iterator keeps advancing and the next interceptor is skipped. IMHO this behaviour is not to be expected (nor documented), so I consider it a bug.The text was updated successfully, but these errors were encountered: