在反向代理后面运行时更改OData V4的Urls

时间:2019-05-22 14:53:42

标签: .net .net-core odata asp.net-core-webapi

使用.Net Core WebAPI,我想更改输出中的OData URL。 API在反向代理后面运行,我希望OData输出中的所有URL都相对于网关。

API的当前输出-

{
    "@odata.type": "#JDA.CatMan.CKB.Users.Models.User",
    "@odata.id": "http://localhost:7004/Users/api/v1/odata/Users(1)",
    "@odata.editLink": "http://localhost:7004/Users/api/v1/odata/Users(1)",
    "userId": 1,
    "userName": "ckbadmin",
    "email": null,
    "isWindowsUser": false,
    "isLocked": false,
    "createDate@odata.type": "#DateTimeOffset",
    "createDate": "2019-05-20T07:46:59.187+05:30",
    "lastLoginDate@odata.type": "#DateTimeOffset",
    "lastLoginDate": "2019-05-22T15:52:11.437+05:30",
    "lastPwdChangeDate": null,
    "failedPwdAttemptCount": null,
    "failedPwdAttemptWinStart": null,
    "failedPwdAnswerAttemptCount": null,
    "failedPwdAnswerAttemptWinStart": null,
    "lastLockedOutDate": null,
    "ipAddress": null,
    "userComment": "Updated through Integration Test - 636940686334591343",
    "userRoles@odata.associationLink": "http://localhost:7004/Users/api/v1/odata/Users(1)/userRoles/$ref",
    "userRoles@odata.navigationLink": "http://localhost:7004/Users/api/v1/odata/Users(1)/userRoles"
}

将网址-“ http://localhost:7004/Users/api/v1/odata”更改为“ http://localhost:7000/Users

我已经通过下面的链接- https://issues.oasis-open.org/browse/ODATA-527

0 个答案:

没有答案