Refactored http/https detection to remove offensive if statement.