mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-20 10:58:16 +08:00
Remove Ocelot specific Middleware to make Ocelot more compatible with kestrel middleware and get ready for YARP
This commit is contained in:
@ -3,6 +3,7 @@ namespace Ocelot.UnitTests.Headers
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Moq;
|
||||
using Ocelot.Configuration;
|
||||
using Ocelot.DownstreamRouteFinder.Middleware;
|
||||
using Ocelot.Headers;
|
||||
using Ocelot.Infrastructure;
|
||||
using Ocelot.Infrastructure.RequestData;
|
||||
@ -263,8 +264,11 @@ namespace Ocelot.UnitTests.Headers
|
||||
|
||||
private void WhenICallTheReplacer()
|
||||
{
|
||||
var context = new DownstreamContext(new DefaultHttpContext()) { DownstreamResponse = _response, DownstreamRequest = _request };
|
||||
_result = _replacer.Replace(context, _headerFindAndReplaces);
|
||||
var httpContext = new DefaultHttpContext();
|
||||
httpContext.Items.UpsertDownstreamResponse(_response);
|
||||
httpContext.Items.UpsertDownstreamRequest(_request);
|
||||
|
||||
_result = _replacer.Replace(httpContext, _headerFindAndReplaces);
|
||||
}
|
||||
|
||||
private void ThenTheHeaderShouldBe(string key, string value)
|
||||
|
Reference in New Issue
Block a user