Fix a bug with redirect request