mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-26 23:27:55 +03:00
fix parsing of API versions header
This commit is contained in:
parent
0e2c0c4d9b
commit
ae68495fab
2 changed files with 3 additions and 3 deletions
|
@ -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!
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue