public static bool ShouldCreateUserContext(CallContext callContext) { if (!EsoRequest.IsEsoRequest(callContext.HttpContext.Request)) { return(true); } bool flag = callContext.EffectiveCallerSid.Equals(OWAMessageInspector.LocalSystemSid); bool isLocal = callContext.HttpContext.Request.IsLocal; if (flag && isLocal) { return(false); } throw new OwaInvalidRequestException(string.Format("EsoRequest Invalid Request from '{0}' originated in '{1}'.", callContext.EffectiveCaller.PrimarySmtpAddress ?? "<unknown SMTP Address>", callContext.HttpContext.Request.UserHostAddress ?? "<unknown host>")); }
// Token: 0x0600168A RID: 5770 RVA: 0x000533A4 File Offset: 0x000515A4 internal override bool UseHttpHandlerFactory(HttpContext httpContext) { if (OwaServiceHttpHandlerFactory.FlightEnableOverride.Member) { return(true); } if (Globals.IsAnonymousCalendarApp) { return(false); } if (EsoRequest.IsEsoRequest(httpContext.Request)) { return(false); } UserContext userContext = UserContextManager.GetMailboxContext(httpContext, null, true) as UserContext; return(userContext != null && userContext.FeaturesManager.ServerSettings.OwaHttpHandler.Enabled); }
internal static void InternalCheckClientVersion(CallContext callContext, Func <string, string> headerGetter) { if (EsoRequest.IsEsoRequest(callContext.HttpContext.Request)) { return; } string text = headerGetter("X-OWA-VersionId"); string clientOwsVersionString = headerGetter("X-OWA-ClientOWSVersion"); UserContext userContext = UserContextManager.GetMailboxContext(HttpContext.Current, null, true) as UserContext; bool flag = userContext != null && userContext.FeaturesManager.ServerSettings.OwaVNext.Enabled; bool flag2; if (userContext != null && userContext.FeaturesManager.ClientServerSettings.OwaVersioning.Enabled) { flag2 = OwaVersionId.Supports(clientOwsVersionString, flag); } else { flag2 = OwaVersionId.Matches(text, flag); } if (flag2) { return; } string arg = flag ? OwaVersionId.VNext : OwaVersionId.Current; string text2 = string.Format("Server={0}, Client={1}", arg, text); string actionId = headerGetter("X-OWA-ActionId"); if (CallContext.IsQueuedActionId(actionId)) { Microsoft.Exchange.Diagnostics.Components.Services.ExTraceGlobals.CommonAlgorithmTracer.TraceDebug <string>(0L, "[OWAMessageInspector::CheckClientVersion] Ignoring version mismatch because this is a queued action {0}", text2); return; } Microsoft.Exchange.Diagnostics.Components.Services.ExTraceGlobals.CommonAlgorithmTracer.TraceWarning <string>(0L, "[OWAMessageInspector::CheckClientVersion] Client/Server version mismatch: {0}", text2); throw new OwaVersionException(text2, callContext.GetEffectiveAccessingSmtpAddress()); }
public static OwaRequestType GetRequestType(HttpRequest request) { OwaRequestType result; if (Globals.IsAnonymousCalendarApp && RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.PublishedCalendar, true)) { result = OwaRequestType.PublishedCalendarView; } else if (Globals.IsAnonymousCalendarApp && RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.PublishedICal, true)) { result = OwaRequestType.ICalHttpHandler; } else if (Utility.IsResourceRequest(request.Url.LocalPath)) { result = OwaRequestType.Resource; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.OehUrl, true)) { result = OwaRequestType.Oeh; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.LanguagePage, true)) { result = OwaRequestType.LanguagePage; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.Default14Page, true)) { result = OwaRequestType.Form15; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.AttachmentHandler, true)) { result = OwaRequestType.Attachment; } else if (UrlUtilities.IsWacRequest(request)) { result = OwaRequestType.WopiRequest; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.LanguagePost, true)) { result = OwaRequestType.LanguagePost; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.LogoffOwa, true)) { result = OwaRequestType.Logoff; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.ProxyLogon, true)) { result = OwaRequestType.ProxyLogon; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.ProxyPing, true)) { result = OwaRequestType.ProxyPing; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.KeepAlive, true)) { result = OwaRequestType.KeepAlive; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.GroupSubscription, true)) { result = OwaRequestType.GroupSubscriptionRequest; } else if (UrlUtilities.IsRemoteNotificationRequest(request)) { result = OwaRequestType.RemoteNotificationRequest; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.SuiteServiceProxyPage, true)) { result = OwaRequestType.SuiteServiceProxyPage; } else if (request.Url.LocalPath.EndsWith(".owa") && string.Equals(request.Params["ns"], "WebReady", StringComparison.InvariantCultureIgnoreCase)) { result = OwaRequestType.WebReadyRequest; } else if (request.Url.LocalPath.EndsWith(".owa", StringComparison.OrdinalIgnoreCase)) { result = OwaRequestType.Invalid; } else if (RequestDispatcherUtilities.IsOwaUrl(request.Url, OwaUrl.AuthFolderUrl, false)) { result = OwaRequestType.Authorize; } else if (request.Url.LocalPath.EndsWith(".aspx", StringComparison.OrdinalIgnoreCase) || request.Url.LocalPath.EndsWith(".ashx", StringComparison.OrdinalIgnoreCase)) { result = OwaRequestType.Aspx; } else if (request.Url.LocalPath.EndsWith(RequestDispatcherUtilities.VirtualDirectoryNameWithLeadingSlash, StringComparison.OrdinalIgnoreCase) || request.Url.LocalPath.EndsWith(RequestDispatcherUtilities.VirtualDirectoryNameWithLeadingAndTrailingSlash, StringComparison.OrdinalIgnoreCase)) { result = OwaRequestType.Form15; } else if (EsoRequest.IsEsoRequest(request)) { result = OwaRequestType.EsoRequest; } else if (request.Url.LocalPath.Contains("service.svc")) { result = OwaRequestType.ServiceRequest; } else if (request.Url.LocalPath.IndexOf("Speech.reco", StringComparison.OrdinalIgnoreCase) != -1) { result = OwaRequestType.SpeechReco; } else if (Globals.IsPreCheckinApp) { result = OwaRequestType.Form15; } else { result = OwaRequestType.Invalid; } return(result); }