Skip to content

Commit

Permalink
Fix issue when route data could be null.
Browse files Browse the repository at this point in the history
  • Loading branch information
twitchax committed Sep 7, 2021
1 parent 274bd4c commit 023521e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/Core/AspNetCore.Proxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>AspNetCore.Proxy</AssemblyName>
<PackageId>AspNetCore.Proxy</PackageId>
<Version>4.2.0</Version>
<Version>4.2.1</Version>
<PackageProjectUrl>https://github.com/twitchax/aspnetcore.proxy</PackageProjectUrl>

<TargetFrameworks>netcoreapp3.1;netstandard2.0;net5.0</TargetFrameworks>
Expand All @@ -13,7 +13,6 @@
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
</PropertyGroup>


<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.0" />
Expand Down
3 changes: 2 additions & 1 deletion src/Core/Extensions/Basic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ internal static async Task ExecuteProxyOperationAsync(this HttpContext context,
await context.Response.WriteAsync($"Request could not be proxied.\n\nThe {requestType} request cannot be proxied because the underlying proxy definition does not have a definition of that type.").ConfigureAwait(false);
}

internal static ValueTask<string> GetEndpointFromComputerAsync(this HttpContext context, EndpointComputerToValueTask computer) => computer(context, context.GetRouteData().Values);
internal static ValueTask<string> GetEndpointFromComputerAsync(this HttpContext context, EndpointComputerToValueTask computer) =>
computer(context, (context.GetRouteData()?.Values as IDictionary<string, object>) ?? new Dictionary<string, object>());

internal static EndpointComputerToValueTask GetRunProxyComputer(EndpointComputerToValueTask endpointComputer)
{
Expand Down

0 comments on commit 023521e

Please sign in to comment.