19 instantiations of HostHeaderValue
Microsoft.AspNetCore.HeaderParsing (1)
HostHeaderValue.cs (1)
80result = new HostHeaderValue(parsedHost, hs.Port);
Microsoft.AspNetCore.HeaderParsing.Tests (18)
HostHeaderValueTests.cs (18)
13var host1 = new HostHeaderValue("localhost", 80); 14var sameAsHost1 = new HostHeaderValue("localhost", 80); 15var differentHost = new HostHeaderValue("127.0.0.1", 80); 16var differentPort = new HostHeaderValue("localhost", 443); 26var host1 = new HostHeaderValue("localhost", 80); 27object sameAsHost1 = new HostHeaderValue("localhost", 80); 28object differentHost = new HostHeaderValue("127.0.0.1", 80); 29object differentPort = new HostHeaderValue("localhost", 443); 44var host1 = new HostHeaderValue("localhost", 80); 45var sameAsHost1 = new HostHeaderValue("localhost", 80); 46var differentHost = new HostHeaderValue("127.0.0.1", 80); 47var differentPort = new HostHeaderValue("localhost", 443); 61var host1HashCode = new HostHeaderValue("localhost", 80).GetHashCode(); 62var sameAsHost1HashCode = new HostHeaderValue("localhost", 80).GetHashCode(); 63var differentHostHashCode = new HostHeaderValue("127.0.0.1", 80).GetHashCode(); 64var differentPortHashCode = new HostHeaderValue("localhost", 443).GetHashCode(); 74var hhv = new HostHeaderValue("foo", null); 77hhv = new HostHeaderValue("foo", 82);
28 references to HostHeaderValue
Microsoft.AspNetCore.HeaderParsing (14)
CommonHeaders.cs (1)
20public static HeaderSetup<HostHeaderValue> Host => new(HeaderNames.Host, HostHeaderValueParser.Instance);
HostHeaderValue.cs (9)
14public readonly struct HostHeaderValue : IEquatable<HostHeaderValue> 17/// Initializes a new instance of the <see cref="HostHeaderValue"/> struct. 49public static bool operator ==(HostHeaderValue left, HostHeaderValue right) 60public static bool operator !=(HostHeaderValue left, HostHeaderValue right) 71public static bool TryParse(string value, [NotNullWhen(true)] out HostHeaderValue result) 93public bool Equals(HostHeaderValue other) => Host.Equals(other.Host, StringComparison.Ordinal) && Port == other.Port; 100public override bool Equals(object? obj) => obj is HostHeaderValue hostHeader && Equals(hostHeader);
Parsers\HostHeaderValueParser.cs (4)
9internal sealed class HostHeaderValueParser : HeaderParser<HostHeaderValue> 13public override bool TryParse(StringValues values, [NotNullWhen(true)] out HostHeaderValue result, [NotNullWhen(false)] out string? error) 15if (values.Count != 1 || !HostHeaderValue.TryParse(values[0]!, out var parsedValue))
Microsoft.AspNetCore.HeaderParsing.Tests (14)
HostHeaderValueTests.cs (12)
13var host1 = new HostHeaderValue("localhost", 80); 14var sameAsHost1 = new HostHeaderValue("localhost", 80); 15var differentHost = new HostHeaderValue("127.0.0.1", 80); 16var differentPort = new HostHeaderValue("localhost", 443); 26var host1 = new HostHeaderValue("localhost", 80); 44var host1 = new HostHeaderValue("localhost", 80); 45var sameAsHost1 = new HostHeaderValue("localhost", 80); 46var differentHost = new HostHeaderValue("127.0.0.1", 80); 47var differentPort = new HostHeaderValue("localhost", 443); 74var hhv = new HostHeaderValue("foo", null); 84Assert.False(HostHeaderValue.TryParse(string.Empty, out var _));
ParserTests.cs (2)
21Assert.True(HostHeaderValueParser.Instance.TryParse(sv, out var result, out var error)); 31Assert.False(HostHeaderValueParser.Instance.TryParse(sv, out var result, out var error));