RedirectConfig accepts user-defined functions and it's possible that some of them can throw. RedirectSingle expects it and applies a try-catch block, but we forgot to drain the response payload body before propagating the error.
Modifications:
Drain response payload before propagating an exception during redirect processing;
Enhance tests to validate expected behavior;
Result:
We do not leave undrained response payload if redirect fails with an exception.
Motivation:
RedirectConfig
accepts user-defined functions and it's possible that some of them can throw.RedirectSingle
expects it and applies atry-catch
block, but we forgot to drain the response payload body before propagating the error.Modifications:
Result:
We do not leave undrained response payload if redirect fails with an exception.