AcceptLanguages is correctly recognized as a WCS 2.0 parameter, but any value given results in an error

Description

As posed on the geoserver-user list on 15/12/2015.

When I send a WCS GetCapabilities request adding the AcceptLanguages parameter for example as below:

WCS request with AcceptLanguages

I get an Exception report for an InvalidParameterValue

Failed to set property ACCEPTLANGUAGES in request object using value * of type class java.lang.String java.lang.String cannot be cast to net.opengis.ows20.AcceptLanguagesType

However * is a valid parameter value, as are one or more RFC 4646 character (language) codes.

OWS common (OGC 06-121r9) tells us that if the acceptlanguages parameter is not supported then the service can decide which human readable language it returns, otherwise when it is supported it shall return the best-available language according to the users preference. If the service doesn’t support any of the languages requested by a user, but the request includes a * then the server may return a language of its choice, otherwise it shall return an error…

Note the parameter is valid for all WCS requests not just GetCapabilities.

As languages support isn't yet available for any GeoServer OGC service, I guess the simplest solution would be to treat the acceptlanguages parameter as not known and ignore it.

A nicer touch would be to allow the * parameter or return an error.

Environment

None

Status

Assignee

Unassigned

Reporter

James @ BGS

Triage

Fix versions

None

Affects versions

None

Components

Priority

Medium
Configure