From db2e5d2dceb339b713b600de9930fa6784034f19 Mon Sep 17 00:00:00 2001 From: Miha Zupan Date: Tue, 2 Jan 2024 19:11:08 +0100 Subject: [PATCH] Fix sample in ab-testing.md --- docs/docfx/articles/ab-testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docfx/articles/ab-testing.md b/docs/docfx/articles/ab-testing.md index dbf4620a8..10e496057 100644 --- a/docs/docfx/articles/ab-testing.md +++ b/docs/docfx/articles/ab-testing.md @@ -12,7 +12,7 @@ app.MapReverseProxy(proxyPipeline => // Custom cluster selection proxyPipeline.Use((context, next) => { - context.RequestServices.GetRequiredService(); + var lookup = context.RequestServices.GetRequiredService(); if (lookup.TryGetCluster(ChooseCluster(context), out var cluster)) { context.ReassignProxyRequest(cluster); @@ -24,7 +24,7 @@ app.MapReverseProxy(proxyPipeline => proxyPipeline.UseLoadBalancing(); }); -private string ChooseCluster(HttpContext context) +string ChooseCluster(HttpContext context) { // Decide which cluster to use. This could be random, weighted, based on headers, etc. return Random.Shared.Next(2) == 1 ? "cluster1" : "cluster2";