/
aprogrammer
/
reverse-proxy-ms-yarp
Обзор
Документация
Войти
/
aprogrammer
/
reverse-proxy-ms-yarp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/ReverseProxy/Configuration/WebProxyConfig.cs
50 строк
1 KB
Kahbazi
Use is null instead of == null (#1565)
29 мар 2022, 02:51
Не верифицирован
29 мар 2022, 02:51
9bbdf5e
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; namespace Yarp.ReverseProxy.Configuration; /// <summary> /// Config used to construct <seealso cref="System.Net.WebProxy"/> instance. /// </summary> public sealed record WebProxyConfig : IEquatable<WebProxyConfig> { /// <summary> /// The URI of the proxy server. /// </summary> public Uri? Address { get; init; } /// <summary> /// true to bypass the proxy for local addresses; otherwise, false. /// If null, default value will be used: false /// </summary> public bool? BypassOnLocal { get; init; } /// <summary> /// Controls whether the <seealso cref="System.Net.CredentialCache.DefaultCredentials"/> are sent with requests. /// If null, default value will be used: false /// </summary> public bool? UseDefaultCredentials { get; init; } public bool Equals(WebProxyConfig? other) { if (other is null) { return false; } return Address == other.Address && BypassOnLocal == other.BypassOnLocal && UseDefaultCredentials == other.UseDefaultCredentials; } public override int GetHashCode() { return HashCode.Combine( Address, BypassOnLocal, UseDefaultCredentials ); } }