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

Recent change to content-type support breaks default text/plain

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • http-request-plugin
    • None

      I believe that this change

      https://github.com/jenkinsci/http-request-plugin/commit/8620e917855676506c85d2882a53192191bce6c2

      broke support for not setting the contentType in an httpRequest. Previously, it would not pass any contentType parameter to StringEntity, which meant to use 'text/plain'. Now, I believe if you don't explicitly set the contentType, it passes the value of NOT_SET (which is "") to StringEntity, which then perhaps does something weird and causes requests to fail.

      I have working code that, at some version prior to 1.8.13, worked, and with 1.8.13 does not work. Adding an explicit contentType: 'TEXT_PLAIN' to my httpRequest command causes it to work again.

            janario Janario Oliveira
            llamahunter Richard Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: