public virtual string GetRedirectionProtocol(bool destinationIsSecure) { var page = (IWebScreen)Page; var protocol = (RuntimePlatformUtils.RequestIsHttps(Request) ? "https://" : "http://"); if (destinationIsSecure) { return((!page.isSecure && !RuntimePlatformUtils.RequestIsHttps(Request)) ? "https://" : protocol); } else { return((page.isSecure && RuntimePlatformUtils.RequestIsHttps(Request)) ? "http://" : protocol); } }
protected void InitializeUrls() { Uri uri = new Uri((RuntimePlatformUtils.RequestIsHttps(Request) ? "https": "http") + Request.Url.ToString().Substring(Request.Url.Scheme.Length)); string applicationUrl = AppUtils.Instance.getImagePath(/*internalAccess*/ false, /*includeSessionIdIfNeeded*/ false); actionUrl = ""; bookmarkableUrl = uri.GetLeftPart(UriPartial.Authority) + applicationUrl; List <Pair <string, string> > parameters = new List <Pair <string, string> >(); if (Request.AppRelativeCurrentExecutionFilePath.IndexOf('/', 2) == -1) { AppInfo appInfo = AppInfo.GetAppInfo(); if (appInfo != null) { string pageHeader = appInfo.OsContext.OsISAPIFilter.GetPage(Request); if (appInfo.OsContext.IsCookielessSession || (pageHeader != null && pageHeader.IndexOf('/', 1) != -1)) { actionUrl = applicationUrl; } } actionUrl += AppUtils.GetPageName(heContext, Global.eSpaceId, "InvalidPermissions", parameters, /*useParamsOnlyIfNeededForRule*/ true); } bookmarkableUrl += AppUtils.GetPageName(heContext, Global.eSpaceId, "InvalidPermissions", parameters, /*useParamsOnlyIfNeededForRule*/ false); }