Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-4660

Inconsistent use of org.opennms.web.api.Util.calculateUrlBase( request )

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.8.12, 1.9.8
    • Component/s: Web UI - General
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Environment:
      Fedora 15, opennms-core-1.9.8-0.20110503.0.noarch, opennms-webapp-jetty-1.9.8-0.20110503.0.noarch, java-1.6.0-openjdk-1.6.0.0-55.1.10.fc15.x86_64

      Description

      org.opennms.web.api.Util.calculateUrlBase( request ) is used throughout the OpenNMS web UI to compute the base URL. Unfortunately it's not used consistently. Sometimes when it's used it's assumed that the returned value has a trailing backslash. For example it is used in the ActionDiscoveryServlet like this:

      response.sendRedirect(Util.calculateUrlBase(request)+"event/query?msgmatchany=Discovery");

      In other cases a backslash is added, as in NodeLabelChangeServlet:

      response.sendRedirect(Util.calculateUrlBase(request) + "/element/node.jsp?node=" + nodeIdString);

      This causes some URLs in the web UI to have a double backslash, that causes a 404 because
      of the extra backslash:

      http://myhost:8980/opennms//element/node.jsp?node=17

      I've attached a patch that compiles, but hasn't been tested yet...

        Attachments

          Activity

            People

            • Assignee:
              ranger Benjamin Reed
              Reporter:
              jcollie Jeffrey Ollie
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: