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

@ -81,6 +81,7 @@ Placeholders
Ocelot allows placeholders that can be used in header transformation.
{RemoteIpAddress} - This will find the clients IP address using _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString() so you will get back some IP.
{BaseUrl} - This will use Ocelot's base url e.g. http://localhost:5000 as its value.
{DownstreamBaseUrl} - This will use the downstream services base url e.g. http://localhost:5000 as its value. This only works for DownstreamHeaderTransform at the moment.
{TraceId} - This will use the Butterfly APM Trace Id. This only works for DownstreamHeaderTransform at the moment.
@ -120,6 +121,17 @@ finally if you are using a load balancer with Ocelot you will get multiple downs
"AllowAutoRedirect": false,
},
X-Forwarded-For
^^^^^^^^^^^^^^^
An example of using {RemoteIpAddress} placeholder...
.. code-block:: json
"UpstreamHeaderTransform": {
"X-Forwarded-For": "{RemoteIpAddress}"
}
Future
^^^^^^