Skip to content

Commit cb7888b

Browse files
author
Chris Martinez
committed
Fix NullReferenceException in unversioned route constraint. Fixes #531
1 parent ed31721 commit cb7888b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Microsoft.AspNetCore.OData.Versioning/AspNet.OData/Routing/UnversionedODataPathRouteConstraint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public bool Match( HttpContext httpContext, IRouter route, string routeKey, Rout
5050
// is implicitly matching an api version allowed?
5151
if ( options.AssumeDefaultVersionWhenUnspecified || IsServiceDocumentOrMetadataRoute( values ) )
5252
{
53-
var odata = httpContext.Features.Get<IODataVersioningFeature>();
53+
var odata = httpContext.ODataVersioningFeature();
5454
var model = new ApiVersionModel( odata.MatchingRoutes.Keys, Array.Empty<ApiVersion>() );
5555
var selector = httpContext.RequestServices.GetRequiredService<IApiVersionSelector>();
5656
var requestedApiVersion = feature.RequestedApiVersion = selector.SelectVersion( httpContext.Request, model );

src/Microsoft.AspNetCore.OData.Versioning/Microsoft.AspNetCore.OData.Versioning.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<VersionPrefix>3.2.2</VersionPrefix>
4+
<VersionPrefix>3.2.3</VersionPrefix>
55
<AssemblyVersion>3.2.0.0</AssemblyVersion>
66
<TargetFramework>netstandard2.0</TargetFramework>
77
<AssemblyTitle>Microsoft ASP.NET Core API Versioning for OData v4.0</AssemblyTitle>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fix key as segment route template generation (#526)
1+
Fix NRE in unversioned route constraint (#531)

0 commit comments

Comments
 (0)