Browse Source

Merge pull request #1105 from nextcloud/feature/nextcloud/expose-httpclient

pull/1109/head
Kate 1 year ago committed by GitHub
parent
commit
dca7c816dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/nextcloud/lib/src/client.dart
  2. 2
      packages/nextcloud/lib/src/webdav/client.dart

1
packages/nextcloud/lib/src/client.dart

@ -30,6 +30,7 @@ class NextcloudClient extends DynamiteClient {
final String? language, final String? language,
final AppType appType = AppType.unknown, final AppType appType = AppType.unknown,
final String? userAgentOverride, final String? userAgentOverride,
super.httpClient,
super.cookieJar, super.cookieJar,
}) : super( }) : super(
baseHeaders: language != null ? {'Accept-Language': language} : null, baseHeaders: language != null ? {'Accept-Language': language} : null,

2
packages/nextcloud/lib/src/webdav/client.dart

@ -29,7 +29,7 @@ class WebDavClient {
}) async { }) async {
assert(dataStream == null || data == null, 'Only one of dataStream or data can be specified.'); 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; ..persistentConnection = true;
for (final header in { for (final header in {
HttpHeaders.contentTypeHeader: 'application/xml', HttpHeaders.contentTypeHeader: 'application/xml',

Loading…
Cancel
Save