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

Invoking Config.xml through REST returns BOM

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • Windows Server 2008 R2
      Jenkins v 1.651
      Powershell 3.0

      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
      

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

              Created:
              Updated:
              Resolved: