#438 removed singleton delegating handlers as you cannot have these (#456)

This commit is contained in:
Tom Pallister
2018-07-09 08:08:39 +01:00
committed by GitHub
parent a419ed68dc
commit c8b72f31b5
8 changed files with 643 additions and 601 deletions

View File

@ -9,6 +9,9 @@
using Ocelot.Middleware;
using System;
using IdentityServer4.AccessTokenValidation;
using System.Net.Http;
using System.Threading.Tasks;
using System.Threading;
public class Program
{
@ -35,10 +38,11 @@
});
s.AddOcelot()
.AddCacheManager(x =>
{
x.WithDictionaryHandle();
})
.AddDelegatingHandler<FakeHandler>(true)
// .AddCacheManager(x =>
// {
// x.WithDictionaryHandle();
// })
/*.AddOpenTracing(option =>
{
option.CollectorUrl = "http://localhost:9618";
@ -60,4 +64,15 @@
.Run();
}
}
public class FakeHandler : DelegatingHandler
{
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
Console.WriteLine(request.RequestUri);
//do stuff and optionally call the base handler..
return await base.SendAsync(request, cancellationToken);
}
}
}