IAddressFinder IAddressFinderFactory.CreateAddressFinder(ProtocolType protocolType, string urlAbsolutePath) { ArgumentValidator.ThrowIfNull("urlAbsolutePath", urlAbsolutePath); switch (protocolType) { case ProtocolType.Eas: return(AddressFinderFactory.EasAddressFinder); case ProtocolType.Ecp: break; case ProtocolType.Ews: if (ProtocolHelper.IsEwsGetUserPhotoRequest(urlAbsolutePath)) { return(AddressFinderFactory.EwsUserPhotoAddressFinder); } if (ProtocolHelper.IsEwsODataRequest(urlAbsolutePath)) { return(AddressFinderFactory.EwsODataAddressFinder); } if (ProtocolHelper.IsWsSecurityRequest(urlAbsolutePath) || ProtocolHelper.IsPartnerAuthRequest(urlAbsolutePath) || ProtocolHelper.IsX509CertAuthRequest(urlAbsolutePath)) { return(AddressFinderFactory.EmptyAddressFinder); } return(AddressFinderFactory.EwsAddressFinder); default: if (protocolType == ProtocolType.RpcHttp) { return(AddressFinderFactory.RpcHttpAddressFinder); } if (protocolType == ProtocolType.Mapi) { return(AddressFinderFactory.MapiAddressFinder); } break; } return(AddressFinderFactory.DefaultAddressFinder); }
internal static bool IsODataRequest(HttpRequest request) { return(ProtocolHelper.IsEwsODataRequest(request.Path)); }