From cb0cdecb8fcd23ca15fbb1d5025bd500a9d5feab Mon Sep 17 00:00:00 2001 From: Thomas Carlier Date: Wed, 24 Jul 2024 03:30:34 +1000 Subject: [PATCH] Typos (#2547) * Typos * Update samples/ReverseProxy.Metrics.Sample/Program.cs Co-authored-by: Miha Zupan * Update src/Kubernetes.Controller/Client/IResourceInformer.cs Co-authored-by: Miha Zupan * Update src/Kubernetes.Controller/Client/IResourceInformerRegistration.cs Co-authored-by: Miha Zupan * Update src/ReverseProxy/Configuration/SessionAffinityConfig.cs Co-authored-by: Miha Zupan * Update src/ReverseProxy/Forwarder/ForwarderRequestConfig.cs Co-authored-by: Miha Zupan * Update src/TelemetryConsumption/Sockets/ISocketsTelemetryConsumer.cs Co-authored-by: Miha Zupan * Update src/ReverseProxy/Utilities/TlsFrameHelper.cs Co-authored-by: Miha Zupan * Typos * Update src/ReverseProxy/Delegation/HttpSysDelegator.cs --------- Co-authored-by: Thomas Carlier Co-authored-by: Miha Zupan --- .../ReverseProxy.Metrics-Prometheus.Sample/Program.cs | 2 +- .../PrometheusForwarderMetrics.cs | 2 +- .../ReverseProxy/Program.cs | 2 +- .../ForwarderTelemetryConsumer.cs | 2 +- .../ReverseProxy.Metrics.Sample/PerRequestMetrics.cs | 2 +- samples/ReverseProxy.Metrics.Sample/Program.cs | 2 +- src/Kubernetes.Controller/Caching/ICache.cs | 2 +- src/Kubernetes.Controller/Caching/IngressCache.cs | 2 +- src/Kubernetes.Controller/Client/IResourceInformer.cs | 4 ++-- .../Client/IResourceInformerRegistration.cs | 4 ++-- src/Kubernetes.Controller/Client/ResourceInformer.cs | 2 +- .../Hosting/BackgroundHostedService.cs | 6 +++--- src/Kubernetes.Controller/Queues/IWorkQueue.cs | 2 +- src/Kubernetes.Controller/Queues/WorkQueue.cs | 4 ++-- src/Kubernetes.Controller/Rate/Limiter.cs | 4 ++-- .../Services/IngressController.cs | 4 ++-- src/ReverseProxy/Configuration/ConfigValidator.cs | 4 ++-- .../Configuration/InMemoryConfigProvider.cs | 4 ++-- .../Configuration/SessionAffinityConfig.cs | 2 +- src/ReverseProxy/Delegation/HttpSysDelegator.cs | 2 +- src/ReverseProxy/Forwarder/ForwarderRequestConfig.cs | 2 +- src/ReverseProxy/Forwarder/HttpForwarder.cs | 10 +++++----- src/ReverseProxy/Health/ClusterDestinationsUpdater.cs | 2 +- src/ReverseProxy/Health/EntityActionScheduler.cs | 2 +- .../Health/TransportFailureRateHealthPolicyOptions.cs | 2 +- .../LoadBalancing/RoundRobinLoadBalancingPolicy.cs | 2 +- src/ReverseProxy/Management/IProxyStateLookup.cs | 4 ++-- src/ReverseProxy/Management/ProxyConfigManager.cs | 4 ++-- .../ReverseProxyServiceCollectionExtensions.cs | 2 +- src/ReverseProxy/Model/ClusterState.cs | 2 +- src/ReverseProxy/Model/IReverseProxyFeature.cs | 2 +- .../BaseEncryptedSessionAffinityPolicy.cs | 2 +- .../Transforms/Builder/TransformBuilder.cs | 2 +- .../Transforms/Builder/TransformBuilderContext.cs | 2 +- .../Transforms/ForwardedTransformFactory.cs | 2 +- .../Transforms/RequestHeaderXForwardedForTransform.cs | 2 +- src/ReverseProxy/Utilities/TlsFrameHelper.cs | 6 +++--- 37 files changed, 54 insertions(+), 54 deletions(-) diff --git a/samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/Program.cs b/samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/Program.cs index fccfd70f3..a5634900c 100644 --- a/samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/Program.cs +++ b/samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/Program.cs @@ -12,7 +12,7 @@ builder.Services.AddReverseProxy() .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy")); -//Enable metric collection for all the underlying event counters used by YARP +// Enable metric collection for all the underlying event counters used by YARP builder.Services.AddAllPrometheusMetrics(); var app = builder.Build(); diff --git a/samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/PrometheusForwarderMetrics.cs b/samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/PrometheusForwarderMetrics.cs index 184ecfc6a..fd66ab3bd 100644 --- a/samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/PrometheusForwarderMetrics.cs +++ b/samples/Prometheus/ReverseProxy.Metrics-Prometheus.Sample/PrometheusForwarderMetrics.cs @@ -15,7 +15,7 @@ public sealed class PrometheusForwarderMetrics : IMetricsConsumer { - proxyPipeline.UseSessionAffinity(); // Has no affect on delegation destinations because the response doesn't go through YARP + proxyPipeline.UseSessionAffinity(); // Has no effect on delegation destinations because the response doesn't go through YARP proxyPipeline.UseLoadBalancing(); proxyPipeline.UsePassiveHealthChecks(); proxyPipeline.UseHttpSysDelegation(); diff --git a/samples/ReverseProxy.Metrics.Sample/ForwarderTelemetryConsumer.cs b/samples/ReverseProxy.Metrics.Sample/ForwarderTelemetryConsumer.cs index 71db2419d..1892fea8d 100644 --- a/samples/ReverseProxy.Metrics.Sample/ForwarderTelemetryConsumer.cs +++ b/samples/ReverseProxy.Metrics.Sample/ForwarderTelemetryConsumer.cs @@ -38,7 +38,7 @@ public void OnContentTransferred(DateTime timestamp, bool isRequest, long conten } else { - // We don't get a content stop from http as its returning a stream that is up to the consumer to + // We don't get a content stop from http as it is returning a stream that is up to the consumer to // read, but we know its ended here. metrics.HttpResponseContentStopOffset = metrics.CalcOffset(timestamp); metrics.ResponseBodyLength = contentLength; diff --git a/samples/ReverseProxy.Metrics.Sample/PerRequestMetrics.cs b/samples/ReverseProxy.Metrics.Sample/PerRequestMetrics.cs index 3ecce03af..c0dac5212 100644 --- a/samples/ReverseProxy.Metrics.Sample/PerRequestMetrics.cs +++ b/samples/ReverseProxy.Metrics.Sample/PerRequestMetrics.cs @@ -41,7 +41,7 @@ private PerRequestMetrics() { } public float HttpRequestStopOffset { get; set; } public float ProxyStopOffset { get; set; } - //Info about the request + // Info about the request public ForwarderError Error { get; set; } public long RequestBodyLength { get; set; } public long ResponseBodyLength { get; set; } diff --git a/samples/ReverseProxy.Metrics.Sample/Program.cs b/samples/ReverseProxy.Metrics.Sample/Program.cs index d45801a7c..aad83256d 100644 --- a/samples/ReverseProxy.Metrics.Sample/Program.cs +++ b/samples/ReverseProxy.Metrics.Sample/Program.cs @@ -30,7 +30,7 @@ var app = builder.Build(); // Custom middleware that collects and reports the proxy metrics -// Placed at the beginning so it is the first and last thing run for each request +// Placed at the beginning so that it is the first and last thing to run for each request app.UsePerRequestMetricCollection(); // Middleware used to intercept the WebSocket connection and collect telemetry exposed to WebSocketsTelemetryConsumer diff --git a/src/Kubernetes.Controller/Caching/ICache.cs b/src/Kubernetes.Controller/Caching/ICache.cs index 9241e3f5f..1c65c5c34 100644 --- a/src/Kubernetes.Controller/Caching/ICache.cs +++ b/src/Kubernetes.Controller/Caching/ICache.cs @@ -10,7 +10,7 @@ namespace Yarp.Kubernetes.Controller.Caching; /// -/// ICache service interface holds onto least amount of data necessary +/// ICache service interface holds onto the least amount of data necessary /// for to process work. /// public interface ICache diff --git a/src/Kubernetes.Controller/Caching/IngressCache.cs b/src/Kubernetes.Controller/Caching/IngressCache.cs index f0803779b..3ea272320 100644 --- a/src/Kubernetes.Controller/Caching/IngressCache.cs +++ b/src/Kubernetes.Controller/Caching/IngressCache.cs @@ -15,7 +15,7 @@ namespace Yarp.Kubernetes.Controller.Caching; /// -/// ICache service interface holds onto least amount of data necessary +/// ICache service interface holds onto the least amount of data necessary /// for to process work. /// public class IngressCache : ICache diff --git a/src/Kubernetes.Controller/Client/IResourceInformer.cs b/src/Kubernetes.Controller/Client/IResourceInformer.cs index c4ff63d97..4df011f01 100644 --- a/src/Kubernetes.Controller/Client/IResourceInformer.cs +++ b/src/Kubernetes.Controller/Client/IResourceInformer.cs @@ -50,8 +50,8 @@ public interface IResourceInformer /// /// Returns a task that can be awaited to know when the initial listing of resources is complete. - /// Once an await on this method it is safe to assume that all of the knowledge of this resource - /// type has been made available, and everything going forward will be updatres. + /// Once an await on this method is completed it is safe to assume that all the knowledge of this resource + /// type has been made available. Any new changes will be a result of receiving new updates. /// /// The cancellation token that can be used by other objects or threads to receive notice of cancellation. /// Task. diff --git a/src/Kubernetes.Controller/Client/IResourceInformerRegistration.cs b/src/Kubernetes.Controller/Client/IResourceInformerRegistration.cs index 0503929d9..53fbf4f65 100644 --- a/src/Kubernetes.Controller/Client/IResourceInformerRegistration.cs +++ b/src/Kubernetes.Controller/Client/IResourceInformerRegistration.cs @@ -15,8 +15,8 @@ public interface IResourceInformerRegistration : IDisposable { /// /// Returns a task that can be awaited to know when the initial listing of resources is complete. - /// Once an await on this method it is safe to assume that all of the knowledge of this resource - /// type has been made available, and everything going forward will be updatres. + /// Once an await on this method is completed it is safe to assume that all the knowledge of this resource + /// type has been made available. Any new changes will be a result of receiving new updates. /// /// The cancellation token that can be used by other objects or threads to receive notice of cancellation. /// Task. diff --git a/src/Kubernetes.Controller/Client/ResourceInformer.cs b/src/Kubernetes.Controller/Client/ResourceInformer.cs index 2665c58bb..bb1e150bc 100644 --- a/src/Kubernetes.Controller/Client/ResourceInformer.cs +++ b/src/Kubernetes.Controller/Client/ResourceInformer.cs @@ -85,7 +85,7 @@ protected override void Dispose(bool disposing) } catch (ObjectDisposedException) { - // ignore redundant exception to allow shutdown sequence to progress uninterupted + // ignore redundant exception to allow shutdown sequence to progress uninterrupted } } base.Dispose(disposing); diff --git a/src/Kubernetes.Controller/Hosting/BackgroundHostedService.cs b/src/Kubernetes.Controller/Hosting/BackgroundHostedService.cs index 9014adb89..830d0599c 100644 --- a/src/Kubernetes.Controller/Hosting/BackgroundHostedService.cs +++ b/src/Kubernetes.Controller/Hosting/BackgroundHostedService.cs @@ -26,7 +26,7 @@ public abstract class BackgroundHostedService : IHostedService, IDisposable private bool _disposedValue; #pragma warning disable CA2213 // Disposable fields should be disposed private Task _runTask; -#pragma warning restore CA2213 // Disposable fields should be disposed +#pragma warning restore CA2213 // Disposable fields should be disposed /// /// Initializes a new instance of the class. @@ -169,7 +169,7 @@ protected virtual void Dispose(bool disposing) } catch (ObjectDisposedException) { - // ignore redundant exception to allow shutdown sequence to progress uninterupted + // ignore redundant exception to allow shutdown sequence to progress uninterrupted } try @@ -178,7 +178,7 @@ protected virtual void Dispose(bool disposing) } catch (ObjectDisposedException) { - // ignore redundant exception to allow shutdown sequence to progress uninterupted + // ignore redundant exception to allow shutdown sequence to progress uninterrupted } } diff --git a/src/Kubernetes.Controller/Queues/IWorkQueue.cs b/src/Kubernetes.Controller/Queues/IWorkQueue.cs index 7afd70a41..0bd45ebf5 100644 --- a/src/Kubernetes.Controller/Queues/IWorkQueue.cs +++ b/src/Kubernetes.Controller/Queues/IWorkQueue.cs @@ -49,7 +49,7 @@ public interface IWorkQueue : IDisposable void ShutDown(); /// - /// Shuttings down. + /// Shutting down. /// /// true if XXXX, false otherwise. bool ShuttingDown(); diff --git a/src/Kubernetes.Controller/Queues/WorkQueue.cs b/src/Kubernetes.Controller/Queues/WorkQueue.cs index d5c6e1678..18803d612 100644 --- a/src/Kubernetes.Controller/Queues/WorkQueue.cs +++ b/src/Kubernetes.Controller/Queues/WorkQueue.cs @@ -109,7 +109,7 @@ public void Add(TItem item) } /// - /// Dones the specified item. + /// Done the specified item. /// /// The item. public void Done(TItem item) @@ -150,7 +150,7 @@ public void ShutDown() } /// - /// Shuttings down. + /// Shutting down. /// /// true if XXXX, false otherwise. public bool ShuttingDown() diff --git a/src/Kubernetes.Controller/Rate/Limiter.cs b/src/Kubernetes.Controller/Rate/Limiter.cs index d0ae0cc56..373e8d171 100644 --- a/src/Kubernetes.Controller/Rate/Limiter.cs +++ b/src/Kubernetes.Controller/Rate/Limiter.cs @@ -72,7 +72,7 @@ public Limiter(Limit limit, int burst, TimeProvider timeProvider = default) } /// - /// Check to allow one token effective immediately. + /// Checks if a token is available effective immediately. If so, it is consumed. /// /// true if a token is available and used, false otherwise. public bool Allow() @@ -183,7 +183,7 @@ public async Task WaitAsync(int count, CancellationToken cancellationToken) } /// - /// reserveN is a helper method for AllowN, ReserveN, and WaitN. + /// reserveN is a helper method for AllowN, ReserveN, and WaitN. /// maxFutureReserve specifies the maximum reservation wait duration allowed. /// reserveN returns Reservation, not *Reservation, to avoid allocation in AllowN and WaitN. /// diff --git a/src/Kubernetes.Controller/Services/IngressController.cs b/src/Kubernetes.Controller/Services/IngressController.cs index b894dfb6c..878a2bd8d 100644 --- a/src/Kubernetes.Controller/Services/IngressController.cs +++ b/src/Kubernetes.Controller/Services/IngressController.cs @@ -19,7 +19,7 @@ namespace Yarp.Kubernetes.Controller.Services; /// /// Controller receives notifications from informers. The data which is needed for processing is -/// saved in a instance and resources which need to be reconciled are +/// saved in an instance and resources which need to be reconciled are /// added to an . The background task dequeues /// items and passes them to an service for processing. /// @@ -193,7 +193,7 @@ public override async Task RunAsync(CancellationToken cancellationToken) await registration.ReadyAsync(cancellationToken).ConfigureAwait(false); } - // At this point we know that all of the Ingress and Endpoint caches are at least in sync + // At this point we know that all the Ingress and Endpoint caches are at least in sync // with cluster's state as of the start of this controller. _registrationsReady = true; NotificationIngressChanged(); diff --git a/src/ReverseProxy/Configuration/ConfigValidator.cs b/src/ReverseProxy/Configuration/ConfigValidator.cs index 8c35bbac9..4cf0ca6b6 100644 --- a/src/ReverseProxy/Configuration/ConfigValidator.cs +++ b/src/ReverseProxy/Configuration/ConfigValidator.cs @@ -26,7 +26,7 @@ public ConfigValidator(ITransformBuilder transformBuilder, _clusterValidators = clusterValidators?.ToArray() ?? throw new ArgumentNullException(nameof(clusterValidators)); } - // Note this performs all validation steps without short circuiting in order to report all possible errors. + // Note this performs all validation steps without short-circuiting in order to report all possible errors. public async ValueTask> ValidateRouteAsync(RouteConfig route) { _ = route ?? throw new ArgumentNullException(nameof(route)); @@ -58,7 +58,7 @@ public async ValueTask> ValidateRouteAsync(RouteConfig route) return errors; } - // Note this performs all validation steps without short circuiting in order to report all possible errors. + // Note this performs all validation steps without short-circuiting in order to report all possible errors. public async ValueTask> ValidateClusterAsync(ClusterConfig cluster) { _ = cluster ?? throw new ArgumentNullException(nameof(cluster)); diff --git a/src/ReverseProxy/Configuration/InMemoryConfigProvider.cs b/src/ReverseProxy/Configuration/InMemoryConfigProvider.cs index 23abd5335..4b3dded38 100644 --- a/src/ReverseProxy/Configuration/InMemoryConfigProvider.cs +++ b/src/ReverseProxy/Configuration/InMemoryConfigProvider.cs @@ -90,12 +90,12 @@ public InMemoryConfig(IReadOnlyList routes, IReadOnlyList Routes { get; } /// - /// A snapshot of the list of Clusters which are collections of interchangable destination endpoints + /// A snapshot of the list of Clusters which are collections of interchangeable destination endpoints /// public IReadOnlyList Clusters { get; } /// - /// Fired to indicate the the proxy state has changed, and that this snapshot is now stale + /// Fired to indicate the proxy state has changed, and that this snapshot is now stale /// public IChangeToken ChangeToken { get; } diff --git a/src/ReverseProxy/Configuration/SessionAffinityConfig.cs b/src/ReverseProxy/Configuration/SessionAffinityConfig.cs index 8e24f82ad..e8de2a985 100644 --- a/src/ReverseProxy/Configuration/SessionAffinityConfig.cs +++ b/src/ReverseProxy/Configuration/SessionAffinityConfig.cs @@ -22,7 +22,7 @@ public sealed record SessionAffinityConfig public string? Policy { get; init; } /// - /// Strategy handling missing destination for an affinitized request. + /// Strategy for handling a missing destination for an affinitized request. /// public string? FailurePolicy { get; init; } diff --git a/src/ReverseProxy/Delegation/HttpSysDelegator.cs b/src/ReverseProxy/Delegation/HttpSysDelegator.cs index b06c302da..90fb20618 100644 --- a/src/ReverseProxy/Delegation/HttpSysDelegator.cs +++ b/src/ReverseProxy/Delegation/HttpSysDelegator.cs @@ -106,7 +106,7 @@ static void Delegate( { Log.QueueNoLongerExists(logger, destination.GetHttpSysDelegationQueue(), destination.Model?.Config?.Address, ex); - // The target queue is gone, detach from it so we can try to re-attach + // The target queue is gone. Detach from it so that we can try to re-attach. queue.Detach(queueState); // Attempt to delegate one more time which will try re-initialize the queue diff --git a/src/ReverseProxy/Forwarder/ForwarderRequestConfig.cs b/src/ReverseProxy/Forwarder/ForwarderRequestConfig.cs index a2344dbdf..e8b0dea18 100644 --- a/src/ReverseProxy/Forwarder/ForwarderRequestConfig.cs +++ b/src/ReverseProxy/Forwarder/ForwarderRequestConfig.cs @@ -21,7 +21,7 @@ public sealed record ForwarderRequestConfig /// /// How long a request is allowed to remain idle between any operation completing, after which it will be canceled. /// The default is 100 seconds. The timeout will reset when response headers are received or after successfully reading or - /// writing any request, response, or streaming data like gRPC or WebSockets. TCP keep-alives and HTTP/2 protocol pings will + /// writing any request, response, or streaming data like gRPC or WebSockets. TCP keep-alive packets and HTTP/2 protocol pings will /// not reset the timeout, but WebSocket pings will. /// public TimeSpan? ActivityTimeout { get; init; } diff --git a/src/ReverseProxy/Forwarder/HttpForwarder.cs b/src/ReverseProxy/Forwarder/HttpForwarder.cs index 2e61f7744..ffdabbba8 100644 --- a/src/ReverseProxy/Forwarder/HttpForwarder.cs +++ b/src/ReverseProxy/Forwarder/HttpForwarder.cs @@ -299,7 +299,7 @@ public async ValueTask SendAsync( } // :: Step 9: Wait for completion of step 2: copying request body Client --► Proxy --► Destination - // NOTE: It is possible for the request body to NOT be copied even when there was an incoming requet body, + // NOTE: It is possible for the request body to NOT be copied even when there was an incoming request body, // e.g. when the request includes header `Expect: 100-continue` and the destination produced a non-1xx response. // We must only wait for the request body to complete if it actually started, // otherwise we run the risk of waiting indefinitely for a task that will never complete. @@ -502,7 +502,7 @@ private void FixupUpgradeRequestHeaders(HttpContext context, HttpRequestMessage // If we generate an HttpContent without a Content-Length then for HTTP/1.1 HttpClient will add a Transfer-Encoding: chunked header // even if it's a GET request. Some servers reject requests containing a Transfer-Encoding header if they're not expecting a body. // Try to be as specific as possible about the client's intent to send a body. The one thing we don't want to do is to start - // reading the body early because that has side-effects like 100-continue. + // reading the body early because that has side effects like 100-continue. var request = context.Request; var hasBody = true; var contentLength = request.Headers.ContentLength; @@ -541,7 +541,7 @@ private void FixupUpgradeRequestHeaders(HttpContext context, HttpRequestMessage { hasBody = contentLength > 0; } - // Kestrel HTTP/2: There are no required headers that indicate if there is a request body so we need to sniff other fields. + // Kestrel HTTP/2: There are no required headers that indicate if there is a request body, so we need to sniff other fields. else if (!ProtocolHelper.IsHttp2OrGreater(request.Protocol)) { hasBody = false; @@ -828,7 +828,7 @@ private ForwarderError FixupUpgradeResponseHeaders(HttpContext context, HttpResp Debug.Assert(success); var accept = context.Response.Headers[HeaderNames.SecWebSocketAccept]; var expectedAccept = ProtocolHelper.CreateSecWebSocketAccept(key.ToString()); - if (!string.Equals(expectedAccept, accept, StringComparison.Ordinal)) // Base64 is case sensitive + if (!string.Equals(expectedAccept, accept, StringComparison.Ordinal)) // Base64 is case-sensitive { context.Response.Clear(); context.Response.StatusCode = StatusCodes.Status502BadGateway; @@ -930,7 +930,7 @@ private async ValueTask HandleResponseBodyErrorAsync(HttpContext return error; } - // The response has already started, we must forcefully terminate it so the client doesn't get the + // The response has already started, we must forcefully terminate it so the client doesn't get // the mistaken impression that the truncated response is complete. ResetOrAbort(context, isCancelled: responseBodyCopyResult == StreamCopyResult.Canceled); diff --git a/src/ReverseProxy/Health/ClusterDestinationsUpdater.cs b/src/ReverseProxy/Health/ClusterDestinationsUpdater.cs index 1b00c8923..90ccdd322 100644 --- a/src/ReverseProxy/Health/ClusterDestinationsUpdater.cs +++ b/src/ReverseProxy/Health/ClusterDestinationsUpdater.cs @@ -89,7 +89,7 @@ private void UpdateInternal(ClusterState cluster, IReadOnlyList - /// Default failure rate limit for a destination to be marked as unhealhty that is applied if it's not set on a cluster's metadata. + /// Default failure rate limit for a destination to be marked as unhealthy that is applied if it's not set on a cluster's metadata. /// It's calculated as a percentage of failed requests out of all requests proxied to the same destination in the period. /// The value is in range (0,1). The default is 0.3 (30%). /// diff --git a/src/ReverseProxy/LoadBalancing/RoundRobinLoadBalancingPolicy.cs b/src/ReverseProxy/LoadBalancing/RoundRobinLoadBalancingPolicy.cs index 8ca1382c6..1eb14b3f4 100644 --- a/src/ReverseProxy/LoadBalancing/RoundRobinLoadBalancingPolicy.cs +++ b/src/ReverseProxy/LoadBalancing/RoundRobinLoadBalancingPolicy.cs @@ -27,7 +27,7 @@ internal sealed class RoundRobinLoadBalancingPolicy : ILoadBalancingPolicy // Increment returns the new value and we want the first return value to be 0. var offset = counter.Increment() - 1; - // Preventing negative indicies from being computed by masking off sign. + // Preventing negative indices from being computed by masking off sign. // Ordering of index selection is consistent across all offsets. // There may be a discontinuity when the sign of offset changes. return availableDestinations[(offset & 0x7FFFFFFF) % availableDestinations.Count]; diff --git a/src/ReverseProxy/Management/IProxyStateLookup.cs b/src/ReverseProxy/Management/IProxyStateLookup.cs index f0b76a16d..452c24016 100644 --- a/src/ReverseProxy/Management/IProxyStateLookup.cs +++ b/src/ReverseProxy/Management/IProxyStateLookup.cs @@ -18,7 +18,7 @@ public interface IProxyStateLookup bool TryGetRoute(string id, [NotNullWhen(true)] out RouteModel? route); /// - /// Enumerates all current routes. This is thread safe but the collection may change mid enumeration if the configuration is reloaded. + /// Enumerates all current routes. This is thread safe but the collection may change mid-enumeration if the configuration is reloaded. /// IEnumerable GetRoutes(); @@ -28,7 +28,7 @@ public interface IProxyStateLookup bool TryGetCluster(string id, [NotNullWhen(true)] out ClusterState? cluster); /// - /// Enumerates all current clusters. This is thread safe but the collection may change mid enumeration if the configuration is reloaded. + /// Enumerates all current clusters. This is thread safe but the collection may change mid-enumeration if the configuration is reloaded. /// IEnumerable GetClusters(); } diff --git a/src/ReverseProxy/Management/ProxyConfigManager.cs b/src/ReverseProxy/Management/ProxyConfigManager.cs index 17f3a5327..e2940f774 100644 --- a/src/ReverseProxy/Management/ProxyConfigManager.cs +++ b/src/ReverseProxy/Management/ProxyConfigManager.cs @@ -155,7 +155,7 @@ private static IReadOnlyList ExtractListOfProxyConfigs(IEnumerable internal async Task InitialLoadAsync() { // Trigger the first load immediately and throw if it fails. - // We intend this to crash the app so we don't try listening for further changes. + // We intend this to crash the app, so we don't try listening for further changes. try { var routes = new List(); @@ -367,7 +367,7 @@ private async ValueTask LoadConfigAsyncCore(IProxyConfig config, C catch (Exception exception) { var cluster = clusters[i]; - throw new InvalidOperationException($"Error resolving destinations for cluster {cluster.ClusterId}", exception); + throw new InvalidOperationException($"Error resolving destinations for cluster {cluster.ClusterId}", exception); } clusters[i] = clusters[i] with { Destinations = resolvedDestinations.Destinations }; diff --git a/src/ReverseProxy/Management/ReverseProxyServiceCollectionExtensions.cs b/src/ReverseProxy/Management/ReverseProxyServiceCollectionExtensions.cs index b2a6bcf6c..2a5cb65bb 100644 --- a/src/ReverseProxy/Management/ReverseProxyServiceCollectionExtensions.cs +++ b/src/ReverseProxy/Management/ReverseProxyServiceCollectionExtensions.cs @@ -86,7 +86,7 @@ public static IReverseProxyBuilder LoadFromConfig(this IReverseProxyBuilder buil } /// - /// Registers a singleton IProxyConfigFilter service. Multiple filters are allowed and they will be run in registration order. + /// Registers a singleton IProxyConfigFilter service. Multiple filters are allowed, and they will be run in registration order. /// /// A class that implements IProxyConfigFilter. public static IReverseProxyBuilder AddConfigFilter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(this IReverseProxyBuilder builder) where TService : class, IProxyConfigFilter diff --git a/src/ReverseProxy/Model/ClusterState.cs b/src/ReverseProxy/Model/ClusterState.cs index adbb308a7..feb5dde86 100644 --- a/src/ReverseProxy/Model/ClusterState.cs +++ b/src/ReverseProxy/Model/ClusterState.cs @@ -51,7 +51,7 @@ public ClusterModel Model } /// - /// All of the destinations associated with this cluster. This collection is populated by the configuration system + /// All the destinations associated with this cluster. This collection is populated by the configuration system /// and should only be directly modified in a test environment. /// Call after modifying this collection. /// diff --git a/src/ReverseProxy/Model/IReverseProxyFeature.cs b/src/ReverseProxy/Model/IReverseProxyFeature.cs index 9b25c22db..04939b5fa 100644 --- a/src/ReverseProxy/Model/IReverseProxyFeature.cs +++ b/src/ReverseProxy/Model/IReverseProxyFeature.cs @@ -27,7 +27,7 @@ public interface IReverseProxyFeature /// /// Cluster destinations that can handle the current request. This will initially include all destinations except those - /// currently marked as unhealth if health checks are enabled. + /// currently marked as unhealthy if health checks are enabled. /// IReadOnlyList AvailableDestinations { get; set; } diff --git a/src/ReverseProxy/SessionAffinity/BaseEncryptedSessionAffinityPolicy.cs b/src/ReverseProxy/SessionAffinity/BaseEncryptedSessionAffinityPolicy.cs index 63a55a4f7..c56b9ebdc 100644 --- a/src/ReverseProxy/SessionAffinity/BaseEncryptedSessionAffinityPolicy.cs +++ b/src/ReverseProxy/SessionAffinity/BaseEncryptedSessionAffinityPolicy.cs @@ -69,7 +69,7 @@ public virtual AffinityResult FindAffinitizedDestinations(HttpContext context, C // TODO: Add fast destination lookup by ID if (requestAffinityKey.Key.Equals(GetDestinationAffinityKey(destinations[i]))) { - // It's allowed to affinitize a request to a pool of destinations so as to enable load-balancing among them. + // It's allowed to affinitize a request to a pool of destinations to enable load-balancing among them. // However, we currently stop after the first match found to avoid performance degradation. matchingDestinations = destinations[i]; break; diff --git a/src/ReverseProxy/Transforms/Builder/TransformBuilder.cs b/src/ReverseProxy/Transforms/Builder/TransformBuilder.cs index f9cc4012b..fa35bf46d 100644 --- a/src/ReverseProxy/Transforms/Builder/TransformBuilder.cs +++ b/src/ReverseProxy/Transforms/Builder/TransformBuilder.cs @@ -157,7 +157,7 @@ internal static StructuredTransformer CreateTransformer(TransformBuilderContext { // RequestHeaderOriginalHostKey defaults to false, and CopyRequestHeaders defaults to true. // If RequestHeaderOriginalHostKey was not specified then we need to make sure the transform gets - // added anyways to remove the original host and to observe hosts specified in DestinationConfig. + // added anyway to remove the original host and to observe hosts specified in DestinationConfig. if (!context.RequestTransforms.Any(item => item is RequestHeaderOriginalHostTransform)) { context.AddOriginalHost(false); diff --git a/src/ReverseProxy/Transforms/Builder/TransformBuilderContext.cs b/src/ReverseProxy/Transforms/Builder/TransformBuilderContext.cs index 47c17732d..a84536b34 100644 --- a/src/ReverseProxy/Transforms/Builder/TransformBuilderContext.cs +++ b/src/ReverseProxy/Transforms/Builder/TransformBuilderContext.cs @@ -44,7 +44,7 @@ public class TransformBuilderContext public bool? CopyResponseTrailers { get; set; } /// - /// Indicates if default x-fowarded-* transforms should be added to this route. Disable this if you do not want + /// Indicates if default x-forwarded-* transforms should be added to this route. Disable this if you do not want /// x-forwarded-* headers or have configured your own. /// public bool? UseDefaultForwarders { get; set; } diff --git a/src/ReverseProxy/Transforms/ForwardedTransformFactory.cs b/src/ReverseProxy/Transforms/ForwardedTransformFactory.cs index 9187d1dcc..e71e0909a 100644 --- a/src/ReverseProxy/Transforms/ForwardedTransformFactory.cs +++ b/src/ReverseProxy/Transforms/ForwardedTransformFactory.cs @@ -251,7 +251,7 @@ public bool Build(TransformBuilderContext context, IReadOnlyDictionary -/// Sets or appends the X-Forwarded-For header with the previous clients's IP address. +/// Sets or appends the X-Forwarded-For header with the previous client's IP address. /// public class RequestHeaderXForwardedForTransform : RequestTransform { diff --git a/src/ReverseProxy/Utilities/TlsFrameHelper.cs b/src/ReverseProxy/Utilities/TlsFrameHelper.cs index 7223196e2..e7a969189 100644 --- a/src/ReverseProxy/Utilities/TlsFrameHelper.cs +++ b/src/ReverseProxy/Utilities/TlsFrameHelper.cs @@ -249,7 +249,7 @@ public static int GetFrameSize(ReadOnlySpan frame) // This function will try to parse TLS hello frame and fill details in provided info structure. // If frame was fully processed without any error, function returns true. - // Otherwise it returns false and info may have partial data. + // Otherwise, it returns false and info may have partial data. // It is OK to call it again if more data becomes available. // It is also possible to limit what information is processed. // If callback delegate is provided, it will be called on ALL extensions. @@ -316,7 +316,7 @@ public static bool TryGetFrameInfo(ReadOnlySpan frame, ref TlsFrameInfo in return isComplete; } - // This is similar to TryGetFrameInfo but it will only process SNI. + // This is similar to TryGetFrameInfo, but it will only process SNI. // It returns TargetName as string or NULL if SNI is missing or parsing error happened. public static string? GetServerName(ReadOnlySpan frame) { @@ -329,7 +329,7 @@ public static bool TryGetFrameInfo(ReadOnlySpan frame, ref TlsFrameInfo in return info.TargetName; } - // This function will parse TLS Alert message and it will return alert level and description. + // This function will parse the TLS Alert message, and return the alert level and description. public static bool TryGetAlertInfo(ReadOnlySpan frame, ref TlsAlertLevel level, ref TlsAlertDescription description) { if (frame.Length < 7 || frame[0] != (byte)TlsContentType.Alert)