diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesClient.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesClient.java index 850c5a09..207b4d49 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesClient.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesClient.java @@ -189,7 +189,7 @@ public abstract class NotesClient { String supportedApiVersions = null; final AidlNetworkRequest.PlainHeader supportedApiVersionsHeader = response.getPlainHeader(HEADER_KEY_X_NOTES_API_VERSIONS); if (supportedApiVersionsHeader != null) { - supportedApiVersions = Objects.requireNonNull(supportedApiVersionsHeader.getValue()).replace("\"", ""); + supportedApiVersions = "[" + Objects.requireNonNull(supportedApiVersionsHeader.getValue()) + "]"; } // return these header fields since they should only be saved after successful processing the result! diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesDatabase.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesDatabase.java index a8cbb8e6..b5beeecf 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesDatabase.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesDatabase.java @@ -861,9 +861,9 @@ public class NotesDatabase extends AbstractNotesDatabase { Log.i(TAG, "Given API version is a valid JSON array but does not contain any valid API versions. Do not update database."); } } catch (NumberFormatException e) { - throw new IllegalArgumentException("API version does contain a non-valid version."); + throw new IllegalArgumentException("API version does contain a non-valid version: " + apiVersion); } catch (JSONException e) { - throw new IllegalArgumentException("API version must contain be a JSON array."); + throw new IllegalArgumentException("API version must contain be a JSON array: " + apiVersion); } } else { Log.v(TAG, "Given API version is null. Do not update database");