#160 Rename UrlPrefix.Whole to FullPrefix. Make IsHeadMethod internal

This commit is contained in:
Chris R 2016-08-09 13:41:31 -07:00
parent ce06c0b241
commit 0fc5dc1820
4 changed files with 11 additions and 11 deletions

View File

@ -209,7 +209,7 @@ namespace Microsoft.Net.Http.Server
internal HttpApi.HTTP_VERB KnownMethod { get; } internal HttpApi.HTTP_VERB KnownMethod { get; }
public bool IsHeadMethod => KnownMethod == HttpApi.HTTP_VERB.HttpVerbHEAD; internal bool IsHeadMethod => KnownMethod == HttpApi.HTTP_VERB.HttpVerbHEAD;
public string Method { get; } public string Method { get; }

View File

@ -36,7 +36,7 @@ namespace Microsoft.Net.Http.Server
Port = port; Port = port;
PortValue = portValue; PortValue = portValue;
Path = path; Path = path;
Whole = string.Format(CultureInfo.InvariantCulture, "{0}://{1}:{2}{3}", Scheme, Host, Port, Path); FullPrefix = string.Format(CultureInfo.InvariantCulture, "{0}://{1}:{2}{3}", Scheme, Host, Port, Path);
} }
/// <summary> /// <summary>
@ -169,21 +169,21 @@ namespace Microsoft.Net.Http.Server
public string Port { get; private set; } public string Port { get; private set; }
public int PortValue { get; private set; } public int PortValue { get; private set; }
public string Path { get; private set; } public string Path { get; private set; }
public string Whole { get; private set; } public string FullPrefix { get; private set; }
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return string.Equals(Whole, Convert.ToString(obj), StringComparison.OrdinalIgnoreCase); return string.Equals(FullPrefix, Convert.ToString(obj), StringComparison.OrdinalIgnoreCase);
} }
public override int GetHashCode() public override int GetHashCode()
{ {
return StringComparer.OrdinalIgnoreCase.GetHashCode(Whole); return StringComparer.OrdinalIgnoreCase.GetHashCode(FullPrefix);
} }
public override string ToString() public override string ToString()
{ {
return Whole; return FullPrefix;
} }
} }
} }

View File

@ -49,7 +49,7 @@ namespace Microsoft.Net.Http.Server
var id = _nextId++; var id = _nextId++;
if (_webListener.IsListening) if (_webListener.IsListening)
{ {
_webListener.UrlGroup.RegisterPrefix(item.Whole, id); _webListener.UrlGroup.RegisterPrefix(item.FullPrefix, id);
} }
_prefixes.Add(id, item); _prefixes.Add(id, item);
} }
@ -108,7 +108,7 @@ namespace Microsoft.Net.Http.Server
id = pair.Key; id = pair.Key;
if (_webListener.IsListening) if (_webListener.IsListening)
{ {
_webListener.UrlGroup.UnregisterPrefix(pair.Value.Whole); _webListener.UrlGroup.UnregisterPrefix(pair.Value.FullPrefix);
} }
} }
} }
@ -142,7 +142,7 @@ namespace Microsoft.Net.Http.Server
foreach (var pair in _prefixes) foreach (var pair in _prefixes)
{ {
// We'll get this index back on each request and use it to look up the prefix to calculate PathBase. // We'll get this index back on each request and use it to look up the prefix to calculate PathBase.
_webListener.UrlGroup.RegisterPrefix(pair.Value.Whole, pair.Key); _webListener.UrlGroup.RegisterPrefix(pair.Value.FullPrefix, pair.Key);
} }
} }
} }
@ -155,7 +155,7 @@ namespace Microsoft.Net.Http.Server
foreach (var prefix in _prefixes.Values) foreach (var prefix in _prefixes.Values)
{ {
// ignore possible failures // ignore possible failures
_webListener.UrlGroup.UnregisterPrefix(prefix.Whole); _webListener.UrlGroup.UnregisterPrefix(prefix.FullPrefix);
} }
} }
} }

View File

@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Server.WebListener.FunctionalTests
} }
} }
[Fact] [Fact(Skip = "https://github.com/aspnet/WebListener/issues/210")]
public async Task Caching_JustPublic_NotCached() public async Task Caching_JustPublic_NotCached()
{ {
var requestCount = 1; var requestCount = 1;