mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 04:18:16 +08:00
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user