REST GET resource metadata - file extension can override format parameter

Description

If you make a REST GET request for resource metadata against a resource with a filename that includes an extension that is among the supported configuration formats (xml, html, json), then the filename of the resource will determine the content of the response rather than the format parameter.

For example, the request:

1 http://localhost:8080/geoserver/rest/resource/styles/point.xml?operation=METADATA&format=json

Will return metadata about the resource point.xml in XML format with content-type=application/json

However, the request

1 http://localhost:8080/geoserver/rest/resource/styles/point.sld?operation=METADATA&format=json

Will return metadata about the resource point.sld in JSON format, since sld is not a configuration format.

Environment

None

Status

Assignee

Torben Barsballe

Reporter

Torben Barsballe

Triage

None

Fix versions

Affects versions

2.12-beta

Components

Priority

Medium
Configure