There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-292bf5ed-c72c-4fff-b9e2-d21a6671fbd6 XWIKI-24569 Open

Provide a unique API in url-api module for getServerURL

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-1e64c173-f38f-46ef-b543-7bd9002ba6ef Vincent Massol on 02/Nov/26 20:53
 

I've posted a proposal that covers this issue in a broader design: https://forum.xwiki.org/t/generating-all-urls-through-the-resource-and-url-modules/19064 (design page: https://design.xwiki.org/xwiki/bin/view/Proposal/URLSerialization).

Instead of a new public URLFactory role, it proposes:

  • a single internal ServerURLResolver in url-default, with getServerURL(wikiId) (follows the current request) and getConfiguredServerURL(wikiId) (configuration only, for emails such as reset password), replacing the two copies in oldcore (XWiki#getServerURL and XWikiServletURLFactory#getServerURL);
  • implementing the url normalizer (XWIKI-17023) and adding a canonicalurl one on top of it;
  • callers getting absolute URLs through ResourceReferenceSerializer<ResourceReference, URL> (default hint for the current request, canonical hint for configuration-only URLs), with no direct use of the server URL.

If the proposal is agreed, PR #5855 would be closed in favor of it.