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

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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • http-request-plugin
    • None
    • Tested with v1.8.21

      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

       

          [JENKINS-47356] A Content-Type header is sent by default with DELETE requests

          Lucas Cimon created issue -
          Lucas Cimon made changes -
          Description Original: 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

           
          New: 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

           

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

              Created:
              Updated: