Use requested media type in RestconfDocumentedExceptionMapper 86/72586/1
authorTom Pantelis <tompantelis@gmail.com>
Fri, 1 Jun 2018 21:16:46 +0000 (17:16 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 1 Jun 2018 21:16:46 +0000 (17:16 -0400)
commitb83e7d09a2ca8fb98dd434d8c256402ab378d51b
treec829205a79ab1922408018d1eadd5bfa16bae71d
parent483c08d628b9c9e463155eb6f259d539fba63d64
Use requested media type in RestconfDocumentedExceptionMapper

The code uses headers.getAcceptableMediaTypes() to select the media type
for the response but, from what I've seen, that only contains the wildcard "\",
in which case we always return json. We should use the requested media type
via headers.getMediaType(), if set, and fallback to getAcceptableMediaTypes()
or json as default.

Change-Id: I391cf054ddab18ddc2855d8d4337cac376d71825
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/RestconfDocumentedExceptionMapper.java