Rename redirect response creating function
Use proper test for secure connection for redirect response