Skip to content

Commit ede5650

Browse files
committed
docs
1 parent ec8a5b6 commit ede5650

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

docs/features/configuration.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Here is an example ReRoute configuration, You don't need to set all of these thi
2525
"Get"
2626
],
2727
"DownstreamHttpMethod": "",
28+
"DownstreamHttpVersion": "",
2829
"AddHeadersToRequest": {},
2930
"AddClaimsToRequest": {},
3031
"RouteClaimsRequirement": {},
@@ -278,4 +279,9 @@ Registering a callback
278279
{
279280
_callbackHolder.Dispose();
280281
}
281-
}
282+
}
283+
284+
DownstreamHttpVersion
285+
---------------------
286+
287+
Ocelot allows you to choose the HTTP version it will use to make the proxy request. It can be set as "1.0", "1.1" or "2.0".

test/Ocelot.AcceptanceTests/HttpTests.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,44 @@ public HttpTests()
2222
_steps = new Steps();
2323
}
2424

25+
[Fact]
26+
public void should_return_response_200_when_using_http_one()
27+
{
28+
const int port = 53219;
29+
30+
var configuration = new FileConfiguration
31+
{
32+
ReRoutes = new List<FileReRoute>
33+
{
34+
new FileReRoute
35+
{
36+
DownstreamPathTemplate = "/{url}",
37+
DownstreamScheme = "https",
38+
UpstreamPathTemplate = "/{url}",
39+
UpstreamHttpMethod = new List<string> { "Get" },
40+
DownstreamHostAndPorts = new List<FileHostAndPort>
41+
{
42+
new FileHostAndPort
43+
{
44+
Host = "localhost",
45+
Port = port,
46+
},
47+
},
48+
DownstreamHttpMethod = "POST",
49+
DownstreamHttpVersion = "1.0",
50+
DangerousAcceptAnyServerCertificateValidator = true
51+
},
52+
},
53+
};
54+
55+
this.Given(x => x.GivenThereIsAServiceRunningOn($"http://localhost:{port}/", "/", port, HttpProtocols.Http1))
56+
.And(x => _steps.GivenThereIsAConfiguration(configuration))
57+
.And(x => _steps.GivenOcelotIsRunning())
58+
.When(x => _steps.WhenIGetUrlOnTheApiGateway("/"))
59+
.Then(x => _steps.ThenTheStatusCodeShouldBe(HttpStatusCode.OK))
60+
.BDDfy();
61+
}
62+
2563
[Fact]
2664
public void should_return_response_200_when_using_http_one_point_one()
2765
{

0 commit comments

Comments
 (0)