// Token: 0x0600053A RID: 1338 RVA: 0x0001D034 File Offset: 0x0001B234
        protected override Uri GetTargetBackEndServerUrl()
        {
            Uri uri = base.GetTargetBackEndServerUrl();

            if (base.AnchoredRoutingTarget.BackEndServer.Version < Server.E15MinVersion)
            {
                throw new HttpException(500, string.Format("Version < E14 and a WOPI request?  Should not happen....  AnchorMailbox: {0}", base.AnchoredRoutingTarget.AnchorMailbox));
            }
            if (uri.Query.Length == 0)
            {
                throw new HttpException(400, "Unexpected query string format");
            }
            if (!string.IsNullOrEmpty(this.targetMailboxId))
            {
                UriBuilder uriBuilder = new UriBuilder(uri);
                uriBuilder.Path  = AuthenticatedWopiRequestPathHandler.StripMailboxId(HttpUtility.UrlDecode(uriBuilder.Path), this.targetMailboxId);
                uriBuilder.Query = uri.Query.Substring(1) + "&UserEmail=" + HttpUtility.UrlEncode(this.targetMailboxId);
                uri = uriBuilder.Uri;
            }
            if (HttpProxySettings.DFPOWAVdirProxyEnabled.Value)
            {
                return(UrlUtilities.FixDFPOWAVdirUrlForBackEnd(uri, HttpUtility.ParseQueryString(uri.Query)["vdir"]));
            }
            return(uri);
        }
Beispiel #2
0
        protected override Uri GetTargetBackEndServerUrl()
        {
            Uri targetBackEndServerUrl = base.GetTargetBackEndServerUrl();

            if (HttpProxySettings.DFPOWAVdirProxyEnabled.Value)
            {
                string     text       = base.ClientRequest.QueryString[OwaProxyRequestHandler.DFPOWAVdirParam];
                HttpCookie httpCookie = base.ClientRequest.Cookies["X-DFPOWA-Vdir"];
                if (!base.ClientRequest.Url.AbsolutePath.EndsWith("/logoff.owa", StringComparison.OrdinalIgnoreCase))
                {
                    string text2 = string.Empty;
                    if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                    {
                        text2 = httpCookie.Value;
                    }
                    if (!string.IsNullOrEmpty(text))
                    {
                        text = text.Trim();
                        if (OwaProxyRequestHandler.DFPOWAValidVdirValues.Contains(text, StringComparer.OrdinalIgnoreCase))
                        {
                            text2 = text;
                        }
                    }
                    if (!string.IsNullOrEmpty(text2))
                    {
                        return(UrlUtilities.FixDFPOWAVdirUrlForBackEnd(targetBackEndServerUrl, text2));
                    }
                }
            }
            return(UrlUtilities.FixIntegratedAuthUrlForBackEnd(targetBackEndServerUrl));
        }