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

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

    • 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.

          [JENKINS-40873] Recent change to content-type support breaks default text/plain

          I've tried with version 1.8.13, 1.8.12 and 1.8.11 against requestb.in and when the value is NOT_SET it doesn't send the header.

          Do you have any other configuration that could cause this?

          Janario Oliveira added a comment - I've tried with version 1.8.13, 1.8.12 and 1.8.11 against requestb.in and when the value is NOT_SET it doesn't send the header. Do you have any other configuration that could cause this?

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

              Created:
              Updated:
              Resolved: