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

Calling REST /lastBuild/ endpoint on a folder results in infinite redirects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • jenkins 2.277.3
      cloudbees-folder-plugin 6.15

      Erroneously calling /lastBuild/ on a folder results in an infinite redirect loop.

      To reproduce:

      1. Create a folder
      2. Add /lastBuild/ on the folder url and try to connect to it
      3. Chrome gives ERR_TOO_MANY_REDIRECTS

      Example with curl:

      $curl -skLi -u user:password http://jenkins.website.com:8080/job/folder/lastBuild/ HTTP/1.1 302 Found
      Date: Fri, 10 Sep 2021 16:37:10 GMT
      X-Content-Type-Options: nosniff
      Location: http://jenkins.website.com:8080/job/folder/lastBuild/
      Content-Length: 0
      Server: Jetty(9.4.39.v20210325)
      
      HTTP/1.1 302 Found
      Date: Fri, 10 Sep 2021 16:37:11 GMT
      X-Content-Type-Options: nosniff
      Location: http://jenkins.website.com:8080/job/folder/lastBuild/
      Content-Length: 0
      Server: Jetty(9.4.39.v20210325)
      
      HTTP/1.1 302 Found
      Date: Fri, 10 Sep 2021 16:37:11 GMT
      X-Content-Type-Options: nosniff
      Location: http://jenkins.website.com:8080/job/folder/lastBuild/
      Content-Length: 0
      Server: Jetty(9.4.39.v20210325)
      
      HTTP/1.1 302 Found
      Date: Fri, 10 Sep 2021 16:37:12 GMT
      X-Content-Type-Options: nosniff
      Location: http://jenkins.website.com:8080/job/folder/lastBuild/
      Content-Length: 0
      Server: Jetty(9.4.39.v20210325)
      
      . . .

       

            Unassigned Unassigned
            mrichar2 Mark R
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: