Details
-
Sub-task
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
2.10.00
-
None
-
None
Description
For cross-domain and external (including http) linking we need to be able to create a link 'out' of the current domain. For example, link from the current hostname, 'www.onehippo.org' to 'docs.onehippo.org'
Therefore, the logic :
if(external) {
urlString = requestContext.getBaseURL().getHostName() + urlString;
}
must be replaced by fetching the hostname from the SiteMount where the Link belongs to.
Even without external explicitly set to true, we might need to rewrite a link to include http as it might be a link in a different domain. Therefore, we will test the following:
1) If the SiteMount of the HstLinkImpl is different then the one from the current request
AND
2) If the VirtualHost belonging to the SiteMount is different then the one from the current request
If (1) and (2) apply, we will need to create a link including the 'http//....' part