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

@ -70,6 +70,28 @@ namespace Ocelot.UnitTests.Configuration
.BDDfy();
}
[Fact]
public void should_create_with_add_headers_to_request()
{
const string key = "X-Forwarded-For";
const string value = "{RemoteIpAddress}";
var reRoute = new FileReRoute
{
UpstreamHeaderTransform = new Dictionary<string, string>
{
{key, value},
}
};
var expected = new AddHeader(key, value);
this.Given(x => GivenTheReRoute(reRoute))
.When(x => WhenICreate())
.Then(x => ThenTheFollowingAddHeaderToUpstreamIsReturned(expected))
.BDDfy();
}
[Fact]
public void should_use_base_url_placeholder()
{