PUT requests to REST API ignore the Accept header

Description

If we upload a coverage using the REST API, the response is always an XML regardless the Accept header, so it is impossible to get a JSON response:

curl -v -u admin:geoserver -XPUT -H "Accept: application/json" -H "Content-type: image/tiff" --data-binary @mytif.tif http://localhost:8080/geoserver/rest/workspaces/copernicus_nicolaus/coveragestores/mycoverage/file.geotiff

Response:
<coverageStore>
<name>mycoverage</name>
<type>GeoTIFF</type>
<enabled>true</enabled>
....
</coverageStore>

The 'Accept' header should be honoured according to Geoserver documentation:
http://docs.geoserver.org/maintain/en/user/rest/api/details.html#formats-and-representations

"In a POST or PUT operation, the format of content being sent to the server is specified with the Content-type header. For example, to send a representation in XML, use "Content-type: text/xml" or "Content-type: application/xml". As with GET requests, the representation of the content returned from the server is specified by the Accept header or by the format."

Environment

Linux Mint 17 Qiana, Tomcat 7.0.52-1ubuntu0.3,
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

Assignee

Unassigned

Reporter

Cesar Martinez

Triage

None

Fix versions

None

Affects versions

Priority

Medium
Configure