LPS-40928 Fix infinite redirect loop