-
Type: Improvement
-
Status: Closed
-
Priority: Blocker
-
Resolution: Fixed
-
Affects Version/s: V4.0_CS01
-
Fix Version/s: V4.0_CSD03
-
Component/s: ATOM Format, CSDL XML, JSON Format, Protocol
-
Labels:None
-
Environment:
[Applied]
-
Proposal:
-
Resolution:
It is often necessary to place an OData producer behind a (reverse) proxy.
HTTP proxies will alter request URLs. They typically change:
- the scheme (http or https)
- the host
- the port
They can change the path, typically by exchanging a prefix portion.
They also can add, remove, or modify HTTP request and response headers.
They cannot alter message bodies without knowledge beyond HTTP, in our case knowledge of the OData formats
- CSDL
- Atom
- JSON
- anything we might want to add in the future
So message bodies should only contain URLs that need not be altered by HTTP proxies.
This affects request bodies created by OData consumers and response bodies created by OData producers.
Two typical candidates for such "proxy-safe" URLs are
- absolute URLs outside of the domain shielded by the proxy
- relative URLs that are relative to something the proxy can easily alter
In addition resolution of relative URLs should be possible with the information contained in the request-response message pair and no out-of-band knowledge beyond the OData specifications. Note that the service root is out-of-band knowledge: it cannot be calculated from the context URL which is based on the metadata URL, and the service root URL is not a specified part of the metadata document.
Problems with the current rules for relative URLs
- Content-Location header: this header is only available in responses. Also it has special meaning if it deviates from the request URL, so having it in the resolution chain only adds problems and does not add any value
- Batch requests allow three formats for request URLs in the batch body, and the relative format is mentioned last.