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

A Content-Type header is sent by default with DELETE requests

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The following code:

      node {
          httpRequest url: 'http://localhost:8666',
                      httpMode: 'DELETE',
                      requestBody: null,
                      acceptType: 'NOT_SET',
                      contentType: 'NOT_SET',
                      customHeaders: [[name: 'Authorization', value: 'dummy=']],
                      ignoreSslErrors: true,
                      validResponseCodes: '100:600'
      }

      produces the following request:

      DELETE / HTTP/1.1
      Authorization: dummy=
      Content-Length: 0
      Content-Type: application/x-www-form-urlencoded
      Host: localhost:8666
      Connection: Keep-Alive
      User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_91)
      Accept-Encoding: gzip,deflate
      

      While the same with a GET:

      node {
          httpRequest url: 'http://localhost:8666',
                      httpMode: 'GET',
                      requestBody: null,
                      acceptType: 'NOT_SET',
                      contentType: 'NOT_SET',
                      customHeaders: [[name: 'Authorization', value: 'dummy=']],
                      ignoreSslErrors: true,
                      validResponseCodes: '100:600'
      }

      produces:

      GET / HTTP/1.1
      Authorization: dummy=
      Host: localhost:8666
      Connection: Keep-Alive
      User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_91)
      Accept-Encoding: gzip,deflate
      

       

      I couldn't pinpoint exactly what part of the code is responsible from this.
      This may or may not be related to https://issues.jenkins-ci.org/browse/JENKINS-40873

      This would be solved if this issue was implemented: https://issues.jenkins-ci.org/browse/JENKINS-40043

       

        Attachments

          Activity

          lucasc Lucas Cimon created issue -
          lucasc Lucas Cimon made changes -
          Field Original Value New Value
          Description The following code:
          {code:java}
          node {
              httpRequest url: 'http://localhost:8666',
           httpMode: 'DELETE',
           requestBody: null,
           acceptType: 'NOT_SET',
           contentType: 'NOT_SET',
           customHeaders: [[name: 'Authorization', value: 'dummy=']],
           ignoreSslErrors: true,
           validResponseCodes: '100:600'
          }{code}
          produces the following request:
          {code:java}
          DELETE / HTTP/1.1
          Authorization: dummy=
          Content-Length: 0
          Content-Type: application/x-www-form-urlencoded
          Host: localhost:8666
          Connection: Keep-Alive
          User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_91)
          Accept-Encoding: gzip,deflate
          {code}
          While the same with a GET:
          {code:java}
          node {
              httpRequest url: 'http://localhost:8666',
           httpMode: 'GET',
           requestBody: null,
           acceptType: 'NOT_SET',
           contentType: 'NOT_SET',
           customHeaders: [[name: 'Authorization', value: 'dummy=']],
           ignoreSslErrors: true,
           validResponseCodes: '100:600'
          }{code}
          produces:
          {code:java}
          GET / HTTP/1.1
          Authorization: dummy=
          Host: localhost:8666
          Connection: Keep-Alive
          User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_91)
          Accept-Encoding: gzip,deflate
          {code}
           

          I couldn't pinpoint exactly what part of the code is responsible from this.
          This may or may not be related to https://issues.jenkins-ci.org/browse/JENKINS-40873

          This would be solved if this issue was implemented: https://issues.jenkins-ci.org/browse/JENKINS-40043

           
          The following code:
          {code:java}
          node {
              httpRequest url: 'http://localhost:8666',
            httpMode: 'DELETE',
                          requestBody: null,
                          acceptType: 'NOT_SET',
                          contentType: 'NOT_SET',
                          customHeaders: [[name: 'Authorization', value: 'dummy=']],
                          ignoreSslErrors: true,
                          validResponseCodes: '100:600'
          }{code}
          produces the following request:
          {code:java}
          DELETE / HTTP/1.1
          Authorization: dummy=
          Content-Length: 0
          Content-Type: application/x-www-form-urlencoded
          Host: localhost:8666
          Connection: Keep-Alive
          User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_91)
          Accept-Encoding: gzip,deflate
          {code}
          While the same with a GET:
          {code:java}
          node {
              httpRequest url: 'http://localhost:8666',
                          httpMode: 'GET',
                          requestBody: null,
                          acceptType: 'NOT_SET',
                          contentType: 'NOT_SET',
                          customHeaders: [[name: 'Authorization', value: 'dummy=']],
                          ignoreSslErrors: true,
                          validResponseCodes: '100:600'
          }{code}
          produces:
          {code:java}
          GET / HTTP/1.1
          Authorization: dummy=
          Host: localhost:8666
          Connection: Keep-Alive
          User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_91)
          Accept-Encoding: gzip,deflate
          {code}
           

          I couldn't pinpoint exactly what part of the code is responsible from this.
           This may or may not be related to https://issues.jenkins-ci.org/browse/JENKINS-40873

          This would be solved if this issue was implemented: https://issues.jenkins-ci.org/browse/JENKINS-40043

           

            People

            Assignee:
            janario Janario Oliveira
            Reporter:
            lucasc Lucas Cimon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: