Problem/Motivation
The HAL REST API response's _embedded and _links relationship Uris are prepended with a fixed Hostname from url()
. This can cause issues in development/qa/staging environments where the host differs.
A way is needed to make this host configurable.
Proposed resolution
It's quite a simple task, but can be implemented several ways. The most simplistic and easiest way is just to create an entry in the rest.settings config and read the value in the Uri construction method, leaving the default value using the existing url()
function.
We could allow a function, method or service name in the rest.settings or set up some provider classes, but I think this could be overkill.