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

Absolute URLs in delivery pipeline break reverse proxy setups

    XMLWordPrintable

Details

    Description

      I'm having trouble with the URLs being generated for XMLHttpRequests behind a reverse proxy. The URLs generated have the http scheme instead of https.

      I believe this could be solved by changing the URL to be relative instead of absolute.

          public String getApiBaseUrl() {
              return Jenkins.getInstance().getRootUrlFromRequest() + getViewUrl();
          }
      

      See attached screen caps demonstrating the behavior I'm seeing.

      Attachments

        1. delivery-pipeline-plugin.hpi
          338 kB
          Patrik Boström
        2. Screen Shot 2014-07-29 at 9.45.24 AM.png
          33 kB
          Josh Hansen
        3. Screen Shot 2014-07-29 at 9.49.12 AM.png
          70 kB
          Josh Hansen

        Issue Links

          Activity

            Hi Patrik,

            I'm using 0.8.3 and using firefox 31.0 and I've the same issue and I'm getting this:

            Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://<server>/view/<somename>%20pipeline/api/json?_=1408001180386. This can be fixed by moving the resource to the same domain or enabling CORS.

            mbadran mohamed badran added a comment - Hi Patrik, I'm using 0.8.3 and using firefox 31.0 and I've the same issue and I'm getting this: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://<server>/view/<somename>%20pipeline/api/json?_=1408001180386. This can be fixed by moving the resource to the same domain or enabling CORS.

            Will reopen this since the previous fix help in some cases and in some cases not.
            Need to fix it by removing the absolute URL:s.

            patbos Patrik Boström added a comment - Will reopen this since the previous fix help in some cases and in some cases not. Need to fix it by removing the absolute URL:s.

            Have open a PR containing fixes where all absolute urls has been replaced by relative ones.

            https://github.com/Diabol/delivery-pipeline-plugin/pull/80

            Will do some more testing and then merge to master and release.

            patbos Patrik Boström added a comment - Have open a PR containing fixes where all absolute urls has been replaced by relative ones. https://github.com/Diabol/delivery-pipeline-plugin/pull/80 Will do some more testing and then merge to master and release.

            Merged to master

            patbos Patrik Boström added a comment - Merged to master

            Released in 0.8.5

            patbos Patrik Boström added a comment - Released in 0.8.5

            People

              patbos Patrik Boström
              skwash Josh Hansen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: