Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-18140

data-xwiki-rest-url starts with "//" when xwiki.home contains domain with trailing "/"

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Problem:

      Value of "data-xwiki-rest-url" data attribute starts with "//"

      data-xwiki-rest-url="//xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome"

       

      Consequences:

      Functionalities using xm.restURL or $services.rest.url are not working. Most apparent on annotations(if enabled) - as they are fetched via rest api on every page. See https://forum.xwiki.org/t/problem-when-fetching-annotations-after-switching-to-pathbased-false/7886

       

      How to replicate:

      XWIKI version 12.9 - .deb installed on Ubuntu 20+ (tomcat9 + nginx) on www.yourdomain.com

      xwiki.properties

      • url.standard.multiwiki.isPathBased=false

      xwiki.cfg

      1 other subwiki active on different domain (not sure if this is relevant)

      As long as xwiki.home value contains trailing "/" then value of "data-xwiki-rest-url" attribute on html tag starts with "//". When trailing "/" is removed from xwiki.home then "data-wiki-rest-url" contains correct values.

      Note that in xwiki.cfg in the comment section it is explicitly recommended to use trailing /.

       

       

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              DavidBrazda David Brazda
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: