From 9d8aaeffddf036f79de139655aa4e3c7eabbdff2 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sat, 4 Nov 2023 10:42:07 +0100 Subject: [PATCH 1/2] fix(nextcloud): Re-use HttpClient in WebDAV requests Signed-off-by: jld3103 --- packages/nextcloud/lib/src/webdav/client.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextcloud/lib/src/webdav/client.dart b/packages/nextcloud/lib/src/webdav/client.dart index 9a2e9869..52ce8bcf 100644 --- a/packages/nextcloud/lib/src/webdav/client.dart +++ b/packages/nextcloud/lib/src/webdav/client.dart @@ -29,7 +29,7 @@ class WebDavClient { }) async { assert(dataStream == null || data == null, 'Only one of dataStream or data can be specified.'); - final request = await HttpClient().openUrl(method, url) + final request = await rootClient.httpClient.openUrl(method, url) ..persistentConnection = true; for (final header in { HttpHeaders.contentTypeHeader: 'application/xml', From c7f087f8bbc52c2a4f6c52a5bc05cba6015941ca Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sat, 4 Nov 2023 10:42:44 +0100 Subject: [PATCH 2/2] feat(nextcloud): Expose custom HttpClient Signed-off-by: jld3103 --- packages/nextcloud/lib/src/client.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nextcloud/lib/src/client.dart b/packages/nextcloud/lib/src/client.dart index 51585b30..6d032dd5 100644 --- a/packages/nextcloud/lib/src/client.dart +++ b/packages/nextcloud/lib/src/client.dart @@ -30,6 +30,7 @@ class NextcloudClient extends DynamiteClient { final String? language, final AppType appType = AppType.unknown, final String? userAgentOverride, + super.httpClient, super.cookieJar, }) : super( baseHeaders: language != null ? {'Accept-Language': language} : null,