jenkinsci / jenkinsci/http-request-plugin

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

Open
#278 0 comments 0 reactions 0 assignees View on GitHub
component:http-request-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
176
Forks
158
Avg merge
1d 16h
Merged PRs (30d)
3

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

 

---
Originally reported by lucasc, imported from: A Content-Type header is sent by default with DELETE requests


  • assignee: janario
  • status: Open
  • priority: Minor
  • component(s): http-request-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20260702-081740

Raw content of original issue

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

 

  • environment: Tested with v1.8.21

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.