This repository was archived by the owner on Oct 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
androidTest/java/com/onedrive/sdk/http
main/java/com/onedrive/sdk/http Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -306,7 +306,9 @@ public String getJsonResponse() {
306306
307307 @ Override
308308 public Map <String , String > getHeaders () {
309- return new HashMap <>();
309+ final HashMap <String , String > headers = new HashMap <>();
310+ headers .put ("Content-Type" , "application/json" );
311+ return headers ;
310312 }
311313 };
312314 mProvider .setConnectionFactory (new MockSingleConnectionFactory (new TestDataConnection (data )));
Original file line number Diff line number Diff line change @@ -300,7 +300,8 @@ public static <T> OneDriveServiceException createFromConnection(final IHttpReque
300300 OneDriveErrorResponse error = null ;
301301 Exception parsingException = null ;
302302
303- if (headers .get (DefaultHttpProvider .ContentTypeHeaderName ).contains (DefaultHttpProvider .JsonContentType )) {
303+ final String contentType = headers .get (DefaultHttpProvider .ContentTypeHeaderName );
304+ if (contentType != null && contentType .contains (DefaultHttpProvider .JsonContentType )) {
304305 try {
305306 error = serializer .deserializeObject (rawOutput , OneDriveErrorResponse .class );
306307 } catch (final Exception ex ) {
You can’t perform that action at this time.
0 commit comments