Skip to content

Commit 0e77ab2

Browse files
committed
Release version 24.0.2: Support FileRoute.UpstreamHttpMethod IBC
1 parent 5ffad1f commit 0e77ab2

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/AcceptanceSteps.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ public AcceptanceSteps()
5858

5959
protected static FileRoute GivenDefaultRoute(int port) => GivenRoute(port);
6060
protected static FileRoute GivenCatchAllRoute(int port) => GivenRoute(port, "/{everything}", "/{everything}");
61-
protected static FileRoute GivenRoute(int port, string? upstream = null, string? downstream = null) => new()
61+
protected static FileRoute GivenRoute(int port, string? upstream = null, string? downstream = null)
6262
{
63-
DownstreamPathTemplate = downstream ?? "/",
64-
DownstreamHostAndPorts = [ Localhost(port) ],
65-
DownstreamScheme = Uri.UriSchemeHttp,
66-
UpstreamPathTemplate = upstream ?? "/",
67-
UpstreamHttpMethod = [HttpMethods.Get],
68-
};
63+
var r = Activator.CreateInstance<FileRoute>();
64+
r.DownstreamHostAndPorts.Add(Localhost(port));
65+
r.DownstreamPathTemplate = downstream ?? "/";
66+
r.DownstreamScheme = Uri.UriSchemeHttp;
67+
r.UpstreamHttpMethod.Add(HttpMethods.Get);
68+
r.UpstreamPathTemplate = upstream ?? "/";
69+
return r;
70+
}
6971

7072
public void GivenThereIsAConfiguration(FileConfiguration fileConfiguration)
7173
=> GivenThereIsAConfiguration(fileConfiguration, ocelotConfigFileName);

src/FileRouteExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static FileRoute WithPriority(this FileRoute route, int priority)
1818

1919
public static FileRoute WithMethods(this FileRoute route, params string[] methods)
2020
{
21-
route.UpstreamHttpMethod.AddRange(methods);
21+
route.UpstreamHttpMethod = [.. methods];
2222
return route;
2323
}
2424

src/Ocelot.Testing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<IncludeSymbols>True</IncludeSymbols>
99
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1010
<!--Package properties-->
11-
<Version>24.0.1-beta.2</Version>
11+
<Version>24.0.2-beta.1</Version>
1212
<PackageId>Ocelot.Testing</PackageId>
1313
<PackageDescription>A shared library for testing the Ocelot core library and its extension packages, including both acceptance and unit tests</PackageDescription>
1414
<PackageReleaseNotes>https://github.com/ThreeMammals/Ocelot.Testing/releases</PackageReleaseNotes>

0 commit comments

Comments
 (0)