HAL self href to queue item returned from "start build" API is not properly encoded

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The HAL href to a multi-branch queue item is not properly encoding the branch name portion of the URL. Given the following request:

      URL: http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/jdl1/branches/experiment%252Fbuild-locally-docker/runs/
      
      Method: PUT
      
      Headers:
      
      Accept:*/*
      Accept-Encoding:gzip, deflate, sdch
      Accept-Language:en-US,en;q=0.8
      authorization:Bearer *snipped*
      Cache-Control:no-cache
      Connection:keep-alive
      Content-Length:0
      content-type:application/json
      Host:localhost:8080
      Origin:http://localhost:8080
      Pragma:no-cache
      Referer:http://localhost:8080/jenkins/blue/organizations/jenkins/jdl1/branches
      User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
      

      This is the response:

      {
          "_class": "io.jenkins.blueocean.service.embedded.rest.QueueItemImpl",
          "_links": {
              "self": {
                  "_class": "io.jenkins.blueocean.rest.hal.Link",
                  "href": "/blue/rest/organizations/jenkins/pipelines/jdl1/pipelines/experiment%2Fbuild-locally-docker/queue/44/"
              }
          },
          "expectedBuildNumber": 48,
          "id": "44",
          "organization": "jenkins",
          "pipeline": "experiment%2Fbuild-locally-docker",
          "queuedTime": "2016-08-31T17:30:30.051-0400"
      }
      

      This URL is lacking the double-encoded branch name:
      /blue/rest/organizations/jenkins/pipelines/jdl1/pipelines/experiment%2Fbuild-locally-docker/queue/44/

      A request to that URL returns a stapler error

      ./jwtcurl.sh -u cmeyers:cmeyers http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/jdl1/pipelines/experiment%2Fbuild-locally-docker/queue/
      <html><body>
      <h1>404 Not Found</h1>
      

      A request to the double encoded URL returns an empty array (expected, since the run began executing immediately)

      ./jwtcurl.sh -u cmeyers:cmeyers http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/jdl1/pipelines/experiment%252Fbuild-locally-docker/queue/
      []
      

            Assignee:
            Vivek Pandey
            Reporter:
            Cliff Meyers
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: