When Discovery Response.getContent() is not called ( e.g. - when unsuccessful Http status ), the okhttp3.ResponseBody will not get closed. Change semantics of Response so that the okhttp3.ResponseBody is always closed. Otherwise, there is a memory leak. Could have made this change in many ways. Would have preferred to entirely remove containment of okhttp3.Response in the Discovery Response type, but took path of fewest changes.
When Discovery Response.getContent() is not called ( e.g. - when unsuccessful Http status ), the okhttp3.ResponseBody will not get closed. Change semantics of Response so that the okhttp3.ResponseBody is always closed. Otherwise, there is a memory leak. Could have made this change in many ways. Would have preferred to entirely remove containment of okhttp3.Response in the Discovery Response type, but took path of fewest changes.