diff --git a/packages/nextcloud/lib/src/client.dart b/packages/nextcloud/lib/src/client.dart index 278c47be..f3fb95be 100644 --- a/packages/nextcloud/lib/src/client.dart +++ b/packages/nextcloud/lib/src/client.dart @@ -27,10 +27,7 @@ class NextcloudClient extends DynamiteClient { final String? userAgentOverride, super.cookieJar, }) : super( - baseHeaders: ({ - 'Accept-Language': language, - }..removeWhere((final _, final value) => value == null)) - .cast(), + baseHeaders: language != null ? {'Accept-Language': language} : null, userAgent: userAgentOverride ?? appType.userAgent, authentications: [ if (appPassword != null) ...[ diff --git a/packages/nextcloud/lib/src/webdav/client.dart b/packages/nextcloud/lib/src/webdav/client.dart index 9f98a966..b08d4dfd 100644 --- a/packages/nextcloud/lib/src/webdav/client.dart +++ b/packages/nextcloud/lib/src/webdav/client.dart @@ -103,8 +103,8 @@ class WebDavClient { 'OPTIONS', _constructPath(), ); - final davCapabilities = response.headers['dav']?.cast().first ?? ''; - final davSearchCapabilities = response.headers['dasl']?.cast().first ?? ''; + final davCapabilities = response.headers['dav']?.first ?? ''; + final davSearchCapabilities = response.headers['dasl']?.first ?? ''; return WebDavOptions( davCapabilities.split(',').map((final e) => e.trim()).where((final e) => e.isNotEmpty).toSet(), davSearchCapabilities.split(',').map((final e) => e.trim()).where((final e) => e.isNotEmpty).toSet(),