项目作者: AdamCaviness

项目描述 :
Demonstrates an issue with aspnetcore WebApi OData library when a client calls AddRelatedObject and the POST body contains ContentIds like $1.
高级语言: C#
项目地址: git://github.com/AdamCaviness/ODataCoreAddRelatedObject.git
创建时间: 2020-07-14T21:46:44Z
项目社区:https://github.com/AdamCaviness/ODataCoreAddRelatedObject

开源协议:

下载


ODataCoreAddRelatedObject

Demonstrates an issue with aspnetcore WebApi OData library when a client calls AddRelatedObject and the POST body contains ContentIds like $1.

https://github.com/OData/WebApi/issues/2071

Inspect the fix in the Fix branch

https://github.com/AdamCaviness/ODataCoreAddRelatedObject/tree/Fix

Discovery

The crux of the issue is that ContentIdHelpers.ResolveContentId() requires a url, not a querystring. It therefore returned an empty string which resulted in never calling context.Request.CopyAbsoluteUrl() which prevented the request’s path from being updated from the ContentId syntax (like $1) to the expanded uri syntax. You may compare this with my aspnet framework sample to see what was done in ODataBatchRequestItem there.