コード例 #1
0
        private void OnBeginRequestInternal(HttpApplication httpApplication)
        {
            HttpContext context     = httpApplication.Context;
            Uri         url         = context.Request.Url;
            Uri         redirectUri = null;

            if (HttpsRedirectModule.TryGetRedirectUri(url, out redirectUri))
            {
                HttpRedirectCommon.RedirectRequestToNewUri(httpApplication, HttpRedirectCommon.HttpRedirectType.Permanent, redirectUri, "HttpsRedirectUri=");
            }
        }
コード例 #2
0
        private void OnBeginRequestInternal(HttpApplication httpApplication)
        {
            HttpContext context     = httpApplication.Context;
            Uri         url         = context.Request.Url;
            Uri         redirectUri = null;
            bool        flag        = false;

            if (VanityDomainRedirectModule.TryGetRedirectUri(url, VanityDomainRedirectModule.CanonicalHostNameSetting.Value, out redirectUri, out flag))
            {
                HttpRedirectCommon.RedirectRequestToNewUri(httpApplication, HttpRedirectCommon.HttpRedirectType.Permanent, redirectUri, flag ? "VanityDomainRedirectUri=" : "HttpsRedirectUri=");
            }
        }
コード例 #3
0
        private void OnBeginRequestInternal(HttpApplication httpApplication)
        {
            HttpContext context     = httpApplication.Context;
            Uri         url         = context.Request.Url;
            Uri         redirectUri = null;

            if (string.IsNullOrEmpty(AutodiscoverRedirectModule.CanonicalSecureHostNameSetting.Value))
            {
                return;
            }
            if (AutodiscoverRedirectModule.TryGetRedirectUri(url, AutodiscoverRedirectModule.CanonicalSecureHostNameSetting.Value, out redirectUri))
            {
                HttpRedirectCommon.RedirectRequestToNewUri(httpApplication, HttpRedirectCommon.HttpRedirectType.Temporary, redirectUri, "AutodiscoverRedirectUri=");
            }
        }
コード例 #4
0
        private void OnBeginRequestInternal(HttpApplication httpApplication)
        {
            HttpContext context = httpApplication.Context;
            HttpRequest request = context.Request;

            if (context.Request.IsSecureConnection)
            {
                string       text = request.Url.AbsolutePath ?? string.Empty;
                string       requestPathAndQuery = request.Url.PathAndQuery ?? string.Empty;
                string       text2    = request.Url.AbsoluteUri ?? string.Empty;
                HttpResponse response = context.Response;
                if (OwaJavascriptRedirectModule.gallatinSplashPageEnabled && OwaJavascriptRedirectModule.gallatinSplashPageRequiredForUrl.Equals(text2, StringComparison.OrdinalIgnoreCase))
                {
                    context.Server.TransferRequest("/owa/auth/outlookcn.aspx");
                    return;
                }
                if (string.IsNullOrEmpty(text) || text == "/")
                {
                    if (OfflineClientRequestUtilities.IsRequestForAppCachedVersion(context))
                    {
                        string arg = Uri.EscapeUriString(Uri.UnescapeDataString("/owa/" + context.Request.Url.Query));
                        response.StatusCode  = 200;
                        response.ContentType = "text/html";
                        response.Write(string.Format("<!DOCTYPE html><html><head><script type=\"text/javascript\">window.location.replace(\"{0}\" + window.location.hash);</script></head><body></body></html>", arg));
                        response.AppendToLog("OwaJavascriptRedirectUri=/owa/");
                        httpApplication.CompleteRequest();
                        return;
                    }
                    HttpRedirectCommon.RedirectRequestToNewUri(httpApplication, HttpRedirectCommon.HttpRedirectType.Permanent, new UriBuilder(text2)
                    {
                        Path = "/owa/"
                    }.Uri, "Owa301RedirectUri=");
                    return;
                }
                else
                {
                    string empty = string.Empty;
                    if (OwaJavascriptRedirectModule.TryGetOwa302PathAndQuery(text, requestPathAndQuery, out empty))
                    {
                        response.AppendToLog("Owa302RedirectUri=" + empty);
                        response.Redirect(empty);
                    }
                }
            }
        }