mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-04 19:56:49 +02:00
Fix a bug in generic post operation: Do not read the entity if
the responseClass is of type Response. Change-Id: I7dfe5f8ebcf90a8870433f16dfe334ae9a840402
This commit is contained in:
parent
f9f1dbe116
commit
9630554b04
@ -145,7 +145,9 @@ public class HttpSBControllerImpl implements HttpSBController {
|
||||
Class<T> responseClass) {
|
||||
Response response = getResponse(device, request, payload, mediaType);
|
||||
if (response != null && response.hasEntity()) {
|
||||
return response.readEntity(responseClass);
|
||||
// Do not read the entity if the responseClass is of type Response. This would allow the
|
||||
// caller to receive the Response directly and try to read its appropriate entity locally.
|
||||
return responseClass == Response.class ? (T) response : response.readEntity(responseClass);
|
||||
}
|
||||
log.error("Response from device {} for request {} contains no entity", device, request);
|
||||
return null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user