Remove Ocelot specific Middleware to make Ocelot more compatible with kestrel middleware and get ready for YARP

This commit is contained in:
Tom Pallister
2020-05-23 15:48:51 +01:00
committed by GitHub
parent 99a15d8668
commit fe3e8bd23a
214 changed files with 9574 additions and 9919 deletions

View File

@ -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)