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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          janario 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?

          Show
          janario 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?

            People

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

              Dates

              Created:
              Updated:
              Resolved: