Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
9.9.0
-
None
-
9.09
-
Severity 3 - Minor
-
Description
Issue Summary
This is reproducible on Data Center: (yes)
Currently when calling /rest/api/2/mypreferences?key=jira.user.locale endpoint, the results are sent and returned as a String regardless of the Accept: or Content-type: headers.
Using Content-type: text/plain generates a HTTP 415 Unsupported Media Type response.
Steps to Reproduce
- Using Jira 9.9.0 make a PUT request with
curl --silent --verbose --user admin:admin --request PUT --url 'http://localhost:2990/jira/rest/api/2/mypreferences?key=jira.user.locale' --header 'Content-type: application/json' --data-raw 'en_AU'
- Make a GET request
curl --silent --verbose --user admin:admin --request GET --url 'http://localhost:2990/jira/rest/api/2/mypreferences?key=jira.user.locale' --header 'Accept: application/json'
Expected Results
And error should be thrown because the PUT payload and the GET results should be in JSON format.
Actual Results
The PUT response has no error for a raw String payload
HTTP/1.1 204 ... Content-Type: application/json;charset=UTF-8
and the GET request has the payload as a raw String even though we stated Accept: application/json.
HTTP/1.1 200 ... Content-Type: application/json;charset=UTF-8 en_AU
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available.