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

Notifications REST URL is badly computed and can be broken in some conditions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.8.1, 10.9
    • Fix Version/s: 10.10-rc-1, 10.8.2
    • Component/s: Notifications
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      The current code does:

      var restURL = xm.restURL.substring(0, xm.restURL.indexOf('/rest/')) + '/rest/notifications?media=json'; 

      This is not clean at all.
      A correct way to do it would be

      var restURL = "${request.contextPath}/rest/notifications?media=json";
      

      (even if it requires velocity to parse the code, for which I have been criticized in the past)

        Attachments

          Activity

            People

            • Assignee:
              gdelhumeau Guillaume Delhumeau
              Reporter:
              gdelhumeau Guillaume Delhumeau
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: