mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
90 lines
3.0 KiB
C#
90 lines
3.0 KiB
C#
//----------------------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//----------------------------------------------------------------------------
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.ServiceModel;
|
|
using System.ServiceModel.Channels;
|
|
using System.Globalization;
|
|
using System.Web.Hosting;
|
|
using System.Web;
|
|
|
|
namespace System.ServiceModel.Activation
|
|
{
|
|
abstract class HostedTransportConfigurationBase : HostedTransportConfiguration
|
|
{
|
|
List<BaseUriWithWildcard> listenAddresses;
|
|
string scheme;
|
|
|
|
internal protected HostedTransportConfigurationBase(string scheme)
|
|
{
|
|
this.scheme = scheme;
|
|
this.listenAddresses = new List<BaseUriWithWildcard>();
|
|
}
|
|
|
|
internal string Scheme
|
|
{
|
|
get
|
|
{
|
|
return scheme;
|
|
}
|
|
}
|
|
|
|
internal protected IList<BaseUriWithWildcard> ListenAddresses
|
|
{
|
|
get
|
|
{
|
|
return listenAddresses;
|
|
}
|
|
}
|
|
|
|
public override Uri[] GetBaseAddresses(string virtualPath)
|
|
{
|
|
AspNetPartialTrustHelpers.FailIfInPartialTrustOutsideAspNet();
|
|
Uri[] addresses = new Uri[listenAddresses.Count];
|
|
for (int i = 0; i < listenAddresses.Count; i++)
|
|
{
|
|
string absoluteVirtualPath = VirtualPathUtility.ToAbsolute(virtualPath, HostingEnvironmentWrapper.ApplicationVirtualPath);
|
|
addresses[i] = new Uri(listenAddresses[i].BaseAddress, absoluteVirtualPath);
|
|
}
|
|
|
|
return addresses;
|
|
}
|
|
|
|
internal BaseUriWithWildcard FindBaseAddress(Uri uri)
|
|
{
|
|
BaseUriWithWildcard foundBaseAddress = null;
|
|
BaseUriWithWildcard weakBaseAddress = null;
|
|
|
|
for (int i = 0; i < listenAddresses.Count; i++)
|
|
{
|
|
if ((string.Compare(listenAddresses[i].BaseAddress.Scheme, uri.Scheme, StringComparison.OrdinalIgnoreCase) == 0)
|
|
&& (listenAddresses[i].BaseAddress.Port == uri.Port))
|
|
{
|
|
if (listenAddresses[i].HostNameComparisonMode == HostNameComparisonMode.StrongWildcard)
|
|
{
|
|
return listenAddresses[i];
|
|
}
|
|
|
|
if (listenAddresses[i].HostNameComparisonMode == HostNameComparisonMode.WeakWildcard)
|
|
{
|
|
weakBaseAddress = listenAddresses[i];
|
|
}
|
|
|
|
if ((listenAddresses[i].HostNameComparisonMode == HostNameComparisonMode.Exact)
|
|
&& (string.Compare(listenAddresses[i].BaseAddress.Host, uri.Host, StringComparison.OrdinalIgnoreCase) == 0))
|
|
{
|
|
foundBaseAddress = listenAddresses[i];
|
|
}
|
|
}
|
|
}
|
|
|
|
if (foundBaseAddress == null)
|
|
foundBaseAddress = weakBaseAddress;
|
|
|
|
return foundBaseAddress;
|
|
}
|
|
}
|
|
}
|