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