fixed typo in the method alias and fixed if statement to take into account http AND https