You are right, the "naive" fallback is wrong, ProtocolException should be thrown instead as remote server emitted wrong redirection URL. Fixing.