Added code for handling 302 redirect codes.