public EndpointAddressMessageFilter(EndpointAddress address, bool includeHostNameInComparison) { Address = address ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(address)); IncludeHostNameInComparison = includeHostNameInComparison; _helper = new EndpointAddressMessageFilterHelper(Address); if (includeHostNameInComparison) { _comparer = HostUriComparer.Value; } else { if (address.Uri.Scheme.Equals("http", StringComparison.OrdinalIgnoreCase) || address.Uri.Scheme.Equals("https", StringComparison.OrdinalIgnoreCase)) { _comparer = new NoHostUriComparer { ComparePort = false, CompareScheme = false }; } else { _comparer = NoHostUriComparer.Value; } } }
public PrefixEndpointAddressMessageFilter(EndpointAddress address, bool includeHostNameInComparison) { Address = address ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(address)); _helper = new EndpointAddressMessageFilterHelper(Address); _hostNameComparisonMode = includeHostNameInComparison ? HostNameComparisonMode.Exact : HostNameComparisonMode.StrongWildcard; _addressTable = new UriPrefixTable <object>(); _addressTable.RegisterUri(Address.Uri, _hostNameComparisonMode, new object()); }
public EndpointAddressMessageFilter(EndpointAddress address, bool includeHostNameInComparison) { if (address == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("address"); } this.address = address; this.includeHostNameInComparison = includeHostNameInComparison; helper = new EndpointAddressMessageFilterHelper(this.address); if (includeHostNameInComparison) { comparer = HostUriComparer.Value; } else { comparer = NoHostUriComparer.Value; } }