OData / WebApi

OData Web API: A server library built upon ODataLib and WebApi
https://docs.microsoft.com/odata
Other
857 stars 473 forks source link

Support relative URLs #869

Open 9Rune5 opened 7 years ago

9Rune5 commented 7 years ago

When paging occurs, I get an absolute URL at the end of the result set: "@odata.nextLink": "http://mysite.com/odata/mycontainer?$skip=20"

But I happen to have a load balancer in front of mysite.com where the TLS connection is terminated. The URL requested by the client was https://mysite.com/mycontainer and the nextLink URL (plain http) will produce a 404 every time. I could perhaps rewrite URLs with my load balancer, but I'd rather switch to relative URLs first.

http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793048 mentions that the standard supports relative URLs.

I have tried sifting through the source, but have not found an easy mechanism to do this yet. http://stackoverflow.com/a/35782947/1736944 seems to get close, but leaves a few details missing after upgrading to the latest odata assembly.

StefanKert commented 6 years ago

Is there any news on this? We are facing the same issues with our current architecture. Currently, we are invoking the request and change the scheme manually. Relative URLs would be super cool. If I can help you with this I would be glad to do so to get up and running with this feature.

kvskranthikumar commented 5 years ago

Any updates on this, I am too looking for a fix.