TeamMentor.CoreLib.HandleUrlRequest.sslPageIsAvailable C# (CSharp) Method

sslPageIsAvailable() public method

public sslPageIsAvailable ( ) : bool
return bool
        public bool sslPageIsAvailable()
        {
            if (request.Url != null)
            {
                var currentServer = (request.Url.PathAndQuery != "/")
                                        ? request.Url.str().remove(request.Url.PathAndQuery)
                                        : request.Url.str();
                var httpLink = currentServer.replace("http://", "https://");
                if (httpLink.contains("https://"))
                {
                    if (httpLink.uri().HEAD())
                    {
                        "[sslPageIsAvailable] got valid HEAD request from: {0}".debug(httpLink);
                        return true;
                    }
                    "[sslPageIsAvailable]HEAD request to server failed!: {0}".error(httpLink);
                    return false;
                }
                "[sslPageIsAvailable] no https:// on '{0}' original request is '{1}".info(currentServer,request.Url.str());
            }
            return false;
        }