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

Invoking Config.xml through REST returns BOM

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Windows Server 2008 R2
      Jenkins v 1.651
      Powershell 3.0
    • Similar Issues:

      Description

      When invoking the Jenkins rest api for Freestyle jobs, the response began returning a BOM appended to the beginning:
      <?xml version="1.0" encoding="UTF-8"?>

      This is causing malformed XML.
      I know this script was working in my last known jenkins ver : 1.627

      Also, interestingly enough, this seems to only be a problem with freestyle jobs, retrieving the config.xml for my Maven jobs return normal XML data.

      Powershell :

      $url = "http://jenkins:8080/job/JobName/config.xml"
      $cnfg = Invoke-RestMethod -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Uri $url -method GET
      

        Attachments

          Activity

          Hide
          cole9350 Shawn Cole added a comment -

          Issue is due to me posting a UTF-8-BOM type file to the REST api to update it originally

          Show
          cole9350 Shawn Cole added a comment - Issue is due to me posting a UTF-8-BOM type file to the REST api to update it originally

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            cole9350 Shawn Cole
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: