Add a function to check whether the http protocol is "https"
Fixed a bug: when redirect a https url, it will be forwarded to a http url.