Feature/#623 (#632)

* #630 only set status code if response hasnt started, otherwise exception

* #623 made {RemoteIpAddress} available as placeholder so you can do x-forwarded-for

* #623 local address different on mac, windows and linux for integration test
This commit is contained in:
Tom Pallister
2018-09-24 08:22:44 +01:00
committed by GitHub
parent 54cdc74293
commit aa14b2f877
14 changed files with 487 additions and 112 deletions

View File

@ -15,6 +15,9 @@ using Ocelot.Request.Middleware;
namespace Ocelot.UnitTests.Headers
{
using Ocelot.Infrastructure;
using Ocelot.Logging;
public class AddHeadersToRequestClaimToThingTests
{
private readonly AddHeadersToRequest _addHeadersToRequest;
@ -24,11 +27,15 @@ namespace Ocelot.UnitTests.Headers
private List<ClaimToThing> _configuration;
private Response _result;
private Response<string> _claimValue;
private Mock<IPlaceholders> _placeholders;
private Mock<IOcelotLoggerFactory> _factory;
public AddHeadersToRequestClaimToThingTests()
{
_parser = new Mock<IClaimsParser>();
_addHeadersToRequest = new AddHeadersToRequest(_parser.Object);
_placeholders = new Mock<IPlaceholders>();
_factory = new Mock<IOcelotLoggerFactory>();
_addHeadersToRequest = new AddHeadersToRequest(_parser.Object, _placeholders.Object, _factory.Object);
_downstreamRequest = new DownstreamRequest(new HttpRequestMessage(HttpMethod.Get, "http://test.com"));
}