Summary
Jira REST API returns '204 NO CONTENT' that includes content-type.
Environment
- Tested with Jira 7.3.1 and 7.11.1.
Steps to Reproduce
- Run the following CURL command to update custom field in JIRA:
curl -D- -u username:'password' -X PUT --data '{"fields":{"customfield_10501":123}}' -H "Content-Type: application/json" http://localhost/rest/api/2/issue/ABC-123
Expected Results
Jira returns '204 NO CONTENT' without any content-type. As per documented in :
RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1-Section-4.3
Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body
RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1 - Section-7.2
An entity-body is only present in a message when a message-body is present
Since Jira return 204 NO CONTENT for issue updated via REST API
204 NO CONTENT HTTP code - The server has successfully fulfilled the request and that there is no additional content to send in the response payload body.
Jira should not add a content-type to the response since no content is sent from the server.
Actual Results
Jira REST API returns a content-type as below:
Notes
- Some library such as IBM's Axis library will wait for the body content if the Content-Type is detected. Since 204 code did not have a body to return, the library will wait until it timeout before it resumed operation.
Workaround
There is no workaround at the moment.