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

scriptText URL returns extra newlines

    Details

    • Similar Issues:
    • Released As:
      Jenkins 2.189

      Description

      Between 2.184 and 2.186 it seems to have changed how the /scriptText endpoint returns the data, in 2.186 there are extra newlines at the start of the output which break some of our scripts that use this API to run scripts.

      Running the command

      curl -X POST https://jenkins/scriptText -F 'script=println "hello"'

      produces the following output on 2.184:

      hello 

      but it produces this on on 2.186:

      
      
          hello

       

      (On our servers we use crumb issuer and auth but for the sake of simplicity I omitted those from the curl command as I think it is probably irrelevant wrt the issue).

       

        Attachments

          Issue Links

            Activity

            Hide
            danielbeck Daniel Beck added a comment -

            Matt Sicker Could this be from SECURITY-534?

            Show
            danielbeck Daniel Beck added a comment - Matt Sicker Could this be from SECURITY-534?
            Hide
            jvz Matt Sicker added a comment -

            Yeah, that could be. Perhaps we can revert the jelly file and just annotate the base model class?

            Show
            jvz Matt Sicker added a comment - Yeah, that could be. Perhaps we can revert the jelly file and just annotate the base model class?
            Hide
            jvz Matt Sicker added a comment -

            https://github.com/jenkinsci/jenkins/pull/4133

            Figured out the problem. Jelly will trim things by default, but a JEXL expression in l:view was introducing untrimmed whitespace for some reason. Refactoring the JEXL expression into vanilla Jelly tags fixed the whitespace issue.

            Show
            jvz Matt Sicker added a comment - https://github.com/jenkinsci/jenkins/pull/4133 Figured out the problem. Jelly will trim things by default, but a JEXL expression in l:view was introducing untrimmed whitespace for some reason. Refactoring the JEXL expression into vanilla Jelly tags fixed the whitespace issue.

              People

              • Assignee:
                jvz Matt Sicker
                Reporter:
                pistahh Istvan Szekeres
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: