Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57186

New View href is an absolute URL but other menu items are relative URLs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • Jenkins 2.164.2

      The href of the "New View" link in the left panel is constructed differently from the other links and is an absolute URL rather than a relative URL.

       

      I've only noticed this issue because our Jenkins server is setup inside a VPN.  So we VPN into the university and then SSH to our gateway machine.  Thus we use two domain name variants to access Jenkins depending on whether the user is in the lab (thus using "jenkins.int") or outside the lab (thus using "jenkins.vpn").

      The consequence of this is that when an external user accesses the Jenkins server via VPN/SSH using "jenkins.vpn", the "New View" link points to "jenkins.int/newView" instead of "jenkins.vpn/newView".  This means that external users get a 404 error (Server not found) and need to manually correct the url.  (Minor/trivial bug.)

       

      In core/src/main/java/jenkins/model/NewViewLink.java, starting line 45

       

      @Override
      public String getUrlName() {
          String urlName = Jenkins.getInstance().getRootUrl() + URL_NAME;
          return urlName;
      }
      

      the class prepends Jenkins.getInstance().getRootUrl() to URL_NAME.  If "/" is prepended instead, urlName becomes a relative address, and the "New View" link is fixed.

      As I am not familiar with the Jenkins codebase, I'm not sure if this is the right way to fix this problem.

       

       

            Unassigned Unassigned
            nap Napoleon BlownApart
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: