From bff69c345130d50d957f057f99d06697fb026568 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Tue, 9 Jan 2024 21:55:22 +0100 Subject: [PATCH 1/2] feat(dynamite)!: allow clients from the http package Signed-off-by: Nikolas Rimikis --- packages/app/pubspec.lock | 4 +- .../lib/src/helpers/version_checker.dart | 1 + .../dynamite_end_to_end_test/pubspec.yaml | 3 +- .../test/authentication_test.dart | 334 +-- .../test/http_client_mock.dart | 9 - .../test/http_client_mock.mocks.dart | 1932 ----------------- .../test/parameters_test.dart | 403 ++-- .../test/request_body_test.dart | 77 +- .../lib/src/dynamite_client.dart | 56 +- .../lib/src/http_extensions.dart | 24 - .../dynamite/dynamite_runtime/pubspec.yaml | 3 +- .../dynamite_runtime/test/client_test.dart | 65 +- .../neon_framework/lib/src/widgets/image.dart | 2 +- packages/nextcloud/lib/src/webdav/client.dart | 118 +- packages/nextcloud/lib/webdav.dart | 2 +- packages/nextcloud/pubspec.yaml | 3 +- .../fixtures/core/app_password/delete.regexp | 8 +- .../fixtures/core/autocomplete/get.regexp | 5 +- .../test/fixtures/core/avatar/get.regexp | 5 +- .../test/fixtures/core/avatar/get_dark.regexp | 5 +- .../client_login_flow_v2/init_and_poll.regexp | 8 +- .../test/fixtures/core/get_status.regexp | 5 +- .../is_supported_from_capabilities.regexp | 5 +- .../core/is_supported_from_status.regexp | 5 +- .../navigation/get_apps_navigation.regexp | 5 +- .../fixtures/core/ocs/get_capabilities.regexp | 5 +- .../test/fixtures/core/preview/get.regexp | 5 +- .../core/unified_search/get_providers.regexp | 5 +- .../core/unified_search/search.regexp | 5 +- .../dashboard/get_widget_items/v1.regexp | 5 +- .../dashboard/get_widget_items/v2.regexp | 5 +- .../fixtures/dashboard/get_widgets.regexp | 5 +- .../test/fixtures/news/add_feed.regexp | 11 +- .../fixtures/news/add_feed_to_folder.regexp | 8 +- .../test/fixtures/news/create_folder.regexp | 11 +- .../test/fixtures/news/delete_feed.regexp | 11 +- .../test/fixtures/news/delete_folder.regexp | 11 +- .../test/fixtures/news/is_supported.regexp | 5 +- .../test/fixtures/news/list_articles.regexp | 11 +- .../test/fixtures/news/list_folders.regexp | 14 +- .../news/list_updated_articles.regexp | 17 +- .../fixtures/news/mark_article_as_read.regexp | 14 +- .../news/mark_article_as_unread.regexp | 20 +- .../fixtures/news/mark_feed_as_read.regexp | 14 +- .../fixtures/news/mark_folder_as_read.regexp | 17 +- .../fixtures/news/move_feed_to_folder.regexp | 14 +- .../test/fixtures/news/rename_feed.regexp | 11 +- .../test/fixtures/news/rename_folder.regexp | 11 +- .../test/fixtures/news/star_article.regexp | 17 +- .../test/fixtures/news/unstar_article.regexp | 20 +- .../notes/create_note_favorite.regexp | 15 +- .../notes/create_note_not_favorite.regexp | 11 +- .../test/fixtures/notes/delete_note.regexp | 20 +- .../notes/get_and_update_settings.regexp | 11 +- .../test/fixtures/notes/get_note.regexp | 18 +- .../test/fixtures/notes/get_notes.regexp | 17 +- .../test/fixtures/notes/is_supported.regexp | 5 +- .../test/fixtures/notes/update_note.regexp | 17 +- .../update_note_fail_changed_on_server.regexp | 17 +- .../api/send_admin_notification.regexp | 5 +- .../endpoint/delete_all_notifications.regexp | 17 +- .../endpoint/delete_notification.regexp | 17 +- .../endpoint/get_notification.regexp | 14 +- .../endpoint/list_notifications.regexp | 11 +- .../register_and_remove_push_device.regexp | 8 +- .../fixtures/provisioning_api/apps/get.regexp | 8 +- .../users/get_current_user.regexp | 5 +- .../users/get_user_by_username.regexp | 5 +- .../fixtures/settings/logs/download.regexp | 5 +- .../spreed/call/start_and_end_call.regexp | 20 +- .../spreed/chat/get_messages/directly.regexp | 14 +- .../spreed/chat/get_messages/polling.regexp | 14 +- .../fixtures/spreed/chat/send_message.regexp | 8 +- .../spreed/helpers/is_supported.regexp | 5 +- .../spreed/room/create_room/group.regexp | 5 +- .../spreed/room/create_room/one-to-one.regexp | 5 +- .../spreed/room/create_room/public.regexp | 5 +- .../fixtures/spreed/room/get_rooms.regexp | 5 +- .../test/fixtures/spreed/room/session.regexp | 17 +- .../spreed/signaling/get_settings.regexp | 8 +- .../send_and_receive_messages.regexp | 23 +- .../test/fixtures/uppush/create_app.regexp | 8 +- .../test/fixtures/uppush/create_device.regexp | 5 +- .../test/fixtures/uppush/delete_device.regexp | 8 +- .../test/fixtures/uppush/is_installed.regexp | 5 +- .../uppush/matrix_gateway_discovery.regexp | 5 +- .../test/fixtures/uppush/set_keepalive.regexp | 5 +- .../uppush/unifiedpush_discovery.regexp | 5 +- .../user_status/heartbeat/heartbeat.regexp | 11 +- .../predefined_status/find_all.regexp | 5 +- .../user_status/statuses/find_all.regexp | 11 +- .../user_status/clear_message.regexp | 17 +- .../user_status/user_status/find.regexp | 11 +- .../user_status/user_status/get.regexp | 11 +- .../user_status/user_status/set.regexp | 11 +- .../user_status/set_custom_message.regexp | 11 +- .../user_status/set_predefined_message.regexp | 11 +- .../test/fixtures/webdav/filter_files.regexp | 8 - .../webdav/get_directory_props.regexp | 8 - .../fixtures/webdav/get_file_props.regexp | 3 - .../fixtures/webdav/list_directory.regexp | 3 - .../webdav/list_directory_recursively.regexp | 3 - .../webdav/litmus/basic/delete.regexp | 7 +- .../webdav/litmus/basic/delete_coll.regexp | 8 +- .../webdav/litmus/basic/delete_null.regexp | 5 +- .../fixtures/webdav/litmus/basic/mkcol.regexp | 5 +- .../webdav/litmus/basic/mkcol_again.regexp | 8 +- .../litmus/basic/mkcol_no_parent.regexp | 5 +- .../webdav/litmus/basic/options.regexp | 5 +- .../webdav/litmus/basic/put_get.regexp | 7 +- .../litmus/basic/put_get_utf8_segment.regexp | 7 +- .../webdav/litmus/basic/put_no_parent.regexp | 4 +- .../webdav/litmus/copymove/copy_coll.regexp | 76 +- .../litmus/copymove/copy_nodestcoll.regexp | 8 +- .../litmus/copymove/copy_overwrite.regexp | 14 +- .../webdav/litmus/copymove/copy_simple.regexp | 8 +- .../webdav/litmus/copymove/move.regexp | 18 +- .../webdav/litmus/copymove/move_coll.regexp | 81 +- .../webdav/litmus/largefile/large_get.regexp | 7 +- .../fixtures/webdav/remove_properties.regexp | 14 - .../fixtures/webdav/set_properties.regexp | 8 - .../webdav/upload_and_download_file.regexp | 7 +- packages/nextcloud/test/webdav_test.dart | 2 +- .../lib/src/proxy_http_client.dart | 129 +- packages/nextcloud_test/pubspec.yaml | 2 +- 125 files changed, 719 insertions(+), 3595 deletions(-) delete mode 100644 packages/dynamite/dynamite_end_to_end_test/test/http_client_mock.dart delete mode 100644 packages/dynamite/dynamite_end_to_end_test/test/http_client_mock.mocks.dart diff --git a/packages/app/pubspec.lock b/packages/app/pubspec.lock index 30c1c7152e6..e5cde51ec2d 100644 --- a/packages/app/pubspec.lock +++ b/packages/app/pubspec.lock @@ -481,10 +481,10 @@ packages: dependency: transitive description: name: http - sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139 + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.2.0" http_parser: dependency: transitive description: diff --git a/packages/dynamite/dynamite/lib/src/helpers/version_checker.dart b/packages/dynamite/dynamite/lib/src/helpers/version_checker.dart index e0c50c2f8e4..dfa36f7ccdc 100644 --- a/packages/dynamite/dynamite/lib/src/helpers/version_checker.dart +++ b/packages/dynamite/dynamite/lib/src/helpers/version_checker.dart @@ -7,6 +7,7 @@ final dependencies = { 'built_value': Version.parse('8.0.0'), 'collection': Version.parse('1.0.0'), 'dynamite_runtime': Version.parse('0.1.0'), + 'http': Version.parse('1.2.0'), 'meta': Version.parse('1.0.0'), 'uri': Version.parse('1.0.0'), }; diff --git a/packages/dynamite/dynamite_end_to_end_test/pubspec.yaml b/packages/dynamite/dynamite_end_to_end_test/pubspec.yaml index f75b3ab3a4e..bdb84189bbb 100644 --- a/packages/dynamite/dynamite_end_to_end_test/pubspec.yaml +++ b/packages/dynamite/dynamite_end_to_end_test/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: built_value: ^8.0.0 collection: ^1.0.0 dynamite_runtime: ^0.1.0 + http: ^1.2.0 meta: ^1.0.0 uri: ^1.0.0 @@ -18,10 +19,8 @@ dev_dependencies: build_runner: ^2.4.8 built_value_generator: ^8.8.1 dynamite: ^0.1.0 - mockito: ^5.4.4 neon_lints: git: url: https://github.com/nextcloud/neon path: packages/neon_lints test: ^1.25.1 - universal_io: ^2.2.2 diff --git a/packages/dynamite/dynamite_end_to_end_test/test/authentication_test.dart b/packages/dynamite/dynamite_end_to_end_test/test/authentication_test.dart index eb6c7486c27..954d023cce8 100644 --- a/packages/dynamite/dynamite_end_to_end_test/test/authentication_test.dart +++ b/packages/dynamite/dynamite_end_to_end_test/test/authentication_test.dart @@ -1,25 +1,10 @@ -// ignore_for_file: discarded_futures - import 'package:dynamite_end_to_end_test/authentication.openapi.dart'; import 'package:dynamite_runtime/http_client.dart'; -import 'package:mockito/mockito.dart'; +import 'package:http/http.dart'; +import 'package:http/testing.dart'; import 'package:test/test.dart'; -import 'package:universal_io/io.dart'; - -import 'http_client_mock.mocks.dart'; - -late MockHttpClient mockHttpClient; - -class MockHttpOverrides extends HttpOverrides { - @override - HttpClient createHttpClient(SecurityContext? context) => mockHttpClient; -} void main() { - late MockHttpHeaders headers; - late MockHttpClientResponse response; - late MockHttpClientRequest request; - final uri = Uri.parse('example.com'); const basicAuth = DynamiteHttpBasicAuthentication( @@ -31,172 +16,261 @@ void main() { token: 'bearer-token', ); - setUp(() { - mockHttpClient = MockHttpClient(); - HttpOverrides.global = MockHttpOverrides(); - - when(mockHttpClient.openUrl(any, any)).thenAnswer((invocation) { - headers = MockHttpHeaders(); - - response = MockHttpClientResponse(); - when(response.headers).thenReturn(headers); - when(response.transform(any)).thenAnswer((_) => Stream.value('{}')); - when(response.statusCode).thenReturn(200); - - request = MockHttpClientRequest(); - when(request.headers).thenReturn(headers); - when(request.close()).thenAnswer((_) async => response); - return Future.value(request); - }); - }); - test('No Authentication', () async { // no registered authentications - var client = $Client(uri, authentications: []); + var client = $Client( + uri, + authentications: [], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + + return Response('{}', 200); + }), + ); await client.noAuthentication(); - var captured = verify(headers.add(captureAny, captureAny)).captured; - expect(captured, equals(['Accept', 'application/json'])); // registered basic authentication - client = $Client(uri, authentications: const [basicAuth]); + client = $Client( + uri, + authentications: const [basicAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + + return Response('{}', 200); + }), + ); await client.noAuthentication(); - captured = verify(headers.add(captureAny, captureAny)).captured; - expect(captured, equals(['Accept', 'application/json'])); // registered bearer authentication - client = $Client(uri, authentications: const [bearerAuth]); + client = $Client( + uri, + authentications: const [bearerAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + + return Response('{}', 200); + }), + ); await client.noAuthentication(); - captured = verify(headers.add(captureAny, captureAny)).captured; - expect(captured, equals(['Accept', 'application/json'])); // multiple registered authentication - client = $Client(uri, authentications: const [basicAuth, bearerAuth]); + client = $Client( + uri, + authentications: const [basicAuth, bearerAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + + return Response('{}', 200); + }), + ); await client.noAuthentication(); - captured = verify(headers.add(captureAny, captureAny)).captured; - expect(captured, equals(['Accept', 'application/json'])); }); test('Basic authentication', () async { // no registered authentications - var client = $Client(uri, authentications: []); + var client = $Client( + uri, + authentications: [], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + + return Response('{}', 200); + }), + ); expect(() => client.basicAuthentication(), throwsA(isA())); // registered basic authentication - client = $Client(uri, authentications: const [basicAuth]); - await client.basicAuthentication(); - var captured = verify(headers.add(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'Accept', - 'application/json', - 'Authorization', - 'Basic YmVhcmVyLXVzZXJuYW1lOmJlYXJlci1wYXNzd29yZA==', - ]), + client = $Client( + uri, + authentications: const [basicAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect( + request.headers, + equals({ + 'Accept': 'application/json', + 'Authorization': 'Basic YmVhcmVyLXVzZXJuYW1lOmJlYXJlci1wYXNzd29yZA==', + }), + ); + + return Response('{}', 200); + }), ); + await client.basicAuthentication(); // registered bearer authentication - client = $Client(uri, authentications: const [bearerAuth]); + client = $Client( + uri, + authentications: const [bearerAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + + return Response('{}', 200); + }), + ); expect(() => client.basicAuthentication(), throwsA(isA())); // multiple registered authentication - client = $Client(uri, authentications: const [basicAuth, bearerAuth]); - await client.basicAuthentication(); - captured = verify(headers.add(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'Accept', - 'application/json', - 'Authorization', - 'Basic YmVhcmVyLXVzZXJuYW1lOmJlYXJlci1wYXNzd29yZA==', - ]), + client = $Client( + uri, + authentications: const [basicAuth, bearerAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect( + request.headers, + equals({ + 'Accept': 'application/json', + 'Authorization': 'Basic YmVhcmVyLXVzZXJuYW1lOmJlYXJlci1wYXNzd29yZA==', + }), + ); + + return Response('{}', 200); + }), ); + await client.basicAuthentication(); }); test('Bearer authentication', () async { // no registered authentications - var client = $Client(uri, authentications: []); + var client = $Client( + uri, + authentications: [], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + + return Response('{}', 200); + }), + ); expect(() => client.bearerAuthentication(), throwsA(isA())); // registered basic authentication - client = $Client(uri, authentications: const [basicAuth]); + client = $Client( + uri, + authentications: const [basicAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + + return Response('{}', 200); + }), + ); expect(() => client.bearerAuthentication(), throwsA(isA())); // registered bearer authentication - client = $Client(uri, authentications: const [bearerAuth]); - await client.bearerAuthentication(); - var captured = verify(headers.add(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'Accept', - 'application/json', - 'Authorization', - 'Bearer bearer-token', - ]), + client = $Client( + uri, + authentications: const [bearerAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect( + request.headers, + equals({ + 'Accept': 'application/json', + 'Authorization': 'Bearer bearer-token', + }), + ); + + return Response('{}', 200); + }), ); + await client.bearerAuthentication(); // multiple registered authentication - client = $Client(uri, authentications: const [basicAuth, bearerAuth]); - await client.bearerAuthentication(); - captured = verify(headers.add(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'Accept', - 'application/json', - 'Authorization', - 'Bearer bearer-token', - ]), + client = $Client( + uri, + authentications: const [basicAuth, bearerAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect( + request.headers, + equals({ + 'Accept': 'application/json', + 'Authorization': 'Bearer bearer-token', + }), + ); + + return Response('{}', 200); + }), ); + await client.bearerAuthentication(); }); test('Multiple authentications', () async { // no registered authentications - var client = $Client(uri, authentications: []); + var client = $Client( + uri, + authentications: [], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + + return Response('{}', 200); + }), + ); expect(() => client.multipleAuthentications(), throwsA(isA())); // registered basic authentication - client = $Client(uri, authentications: const [basicAuth]); - await client.multipleAuthentications(); - var captured = verify(headers.add(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'Accept', - 'application/json', - 'Authorization', - 'Basic YmVhcmVyLXVzZXJuYW1lOmJlYXJlci1wYXNzd29yZA==', - ]), + client = $Client( + uri, + authentications: const [basicAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect( + request.headers, + equals({ + 'Accept': 'application/json', + 'Authorization': 'Basic YmVhcmVyLXVzZXJuYW1lOmJlYXJlci1wYXNzd29yZA==', + }), + ); + + return Response('{}', 200); + }), ); + await client.multipleAuthentications(); // registered bearer authentication - client = $Client(uri, authentications: const [bearerAuth]); - await client.multipleAuthentications(); - captured = verify(headers.add(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'Accept', - 'application/json', - 'Authorization', - 'Bearer bearer-token', - ]), + client = $Client( + uri, + authentications: const [bearerAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect( + request.headers, + equals({ + 'Accept': 'application/json', + 'Authorization': 'Bearer bearer-token', + }), + ); + + return Response('{}', 200); + }), ); + await client.multipleAuthentications(); // multiple registered authentication - client = $Client(uri, authentications: const [basicAuth, bearerAuth]); - await client.multipleAuthentications(); - captured = verify(headers.add(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'Accept', - 'application/json', - 'Authorization', - 'Basic YmVhcmVyLXVzZXJuYW1lOmJlYXJlci1wYXNzd29yZA==', - ]), + client = $Client( + uri, + authentications: const [basicAuth, bearerAuth], + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect( + request.headers, + equals({ + 'Accept': 'application/json', + 'Authorization': 'Basic YmVhcmVyLXVzZXJuYW1lOmJlYXJlci1wYXNzd29yZA==', + }), + ); + + return Response('{}', 200); + }), ); + await client.multipleAuthentications(); }); } diff --git a/packages/dynamite/dynamite_end_to_end_test/test/http_client_mock.dart b/packages/dynamite/dynamite_end_to_end_test/test/http_client_mock.dart deleted file mode 100644 index 0afeddd140e..00000000000 --- a/packages/dynamite/dynamite_end_to_end_test/test/http_client_mock.dart +++ /dev/null @@ -1,9 +0,0 @@ -@GenerateNiceMocks([ - MockSpec(), - MockSpec(), - MockSpec(), - MockSpec(), -]) - -import 'package:mockito/annotations.dart'; -import 'package:universal_io/io.dart'; diff --git a/packages/dynamite/dynamite_end_to_end_test/test/http_client_mock.mocks.dart b/packages/dynamite/dynamite_end_to_end_test/test/http_client_mock.mocks.dart deleted file mode 100644 index 73643db68f7..00000000000 --- a/packages/dynamite/dynamite_end_to_end_test/test/http_client_mock.mocks.dart +++ /dev/null @@ -1,1932 +0,0 @@ -// Mocks generated by Mockito 5.4.4 from annotations -// in dynamite_end_to_end_test/test/http_client_mock.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i4; -import 'dart:convert' as _i3; -import 'dart:io' as _i2; - -import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i5; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package -// ignore_for_file: implementation_imports -// ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -class _FakeDuration_0 extends _i1.SmartFake implements Duration { - _FakeDuration_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeHttpClientRequest_1 extends _i1.SmartFake implements _i2.HttpClientRequest { - _FakeHttpClientRequest_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeHttpHeaders_3 extends _i1.SmartFake implements _i2.HttpHeaders { - _FakeHttpHeaders_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeHttpClientResponse_4 extends _i1.SmartFake implements _i2.HttpClientResponse { - _FakeHttpClientResponse_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeEncoding_5 extends _i1.SmartFake implements _i3.Encoding { - _FakeEncoding_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeSocket_6 extends _i1.SmartFake implements _i2.Socket { - _FakeSocket_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeStreamSubscription_7 extends _i1.SmartFake implements _i4.StreamSubscription { - _FakeStreamSubscription_7( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeFuture_8 extends _i1.SmartFake implements _i4.Future { - _FakeFuture_8( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -/// A class which mocks [HttpClient]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockHttpClient extends _i1.Mock implements _i2.HttpClient { - @override - Duration get idleTimeout => (super.noSuchMethod( - Invocation.getter(#idleTimeout), - returnValue: _FakeDuration_0( - this, - Invocation.getter(#idleTimeout), - ), - returnValueForMissingStub: _FakeDuration_0( - this, - Invocation.getter(#idleTimeout), - ), - ) as Duration); - - @override - set idleTimeout(Duration? _idleTimeout) => super.noSuchMethod( - Invocation.setter( - #idleTimeout, - _idleTimeout, - ), - returnValueForMissingStub: null, - ); - - @override - set connectionTimeout(Duration? _connectionTimeout) => super.noSuchMethod( - Invocation.setter( - #connectionTimeout, - _connectionTimeout, - ), - returnValueForMissingStub: null, - ); - - @override - set maxConnectionsPerHost(int? _maxConnectionsPerHost) => super.noSuchMethod( - Invocation.setter( - #maxConnectionsPerHost, - _maxConnectionsPerHost, - ), - returnValueForMissingStub: null, - ); - - @override - bool get autoUncompress => (super.noSuchMethod( - Invocation.getter(#autoUncompress), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - set autoUncompress(bool? _autoUncompress) => super.noSuchMethod( - Invocation.setter( - #autoUncompress, - _autoUncompress, - ), - returnValueForMissingStub: null, - ); - - @override - set userAgent(String? _userAgent) => super.noSuchMethod( - Invocation.setter( - #userAgent, - _userAgent, - ), - returnValueForMissingStub: null, - ); - - @override - set authenticate( - _i4.Future Function( - Uri, - String, - String?, - )? f) => - super.noSuchMethod( - Invocation.setter( - #authenticate, - f, - ), - returnValueForMissingStub: null, - ); - - @override - set connectionFactory( - _i4.Future<_i2.ConnectionTask<_i2.Socket>> Function( - Uri, - String?, - int?, - )? f) => - super.noSuchMethod( - Invocation.setter( - #connectionFactory, - f, - ), - returnValueForMissingStub: null, - ); - - @override - set findProxy(String Function(Uri)? f) => super.noSuchMethod( - Invocation.setter( - #findProxy, - f, - ), - returnValueForMissingStub: null, - ); - - @override - set authenticateProxy( - _i4.Future Function( - String, - int, - String, - String?, - )? f) => - super.noSuchMethod( - Invocation.setter( - #authenticateProxy, - f, - ), - returnValueForMissingStub: null, - ); - - @override - set badCertificateCallback( - bool Function( - _i2.X509Certificate, - String, - int, - )? callback) => - super.noSuchMethod( - Invocation.setter( - #badCertificateCallback, - callback, - ), - returnValueForMissingStub: null, - ); - - @override - set keyLog(dynamic Function(String)? callback) => super.noSuchMethod( - Invocation.setter( - #keyLog, - callback, - ), - returnValueForMissingStub: null, - ); - - @override - _i4.Future<_i2.HttpClientRequest> open( - String? method, - String? host, - int? port, - String? path, - ) => - (super.noSuchMethod( - Invocation.method( - #open, - [ - method, - host, - port, - path, - ], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #open, - [ - method, - host, - port, - path, - ], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #open, - [ - method, - host, - port, - path, - ], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> openUrl( - String? method, - Uri? url, - ) => - (super.noSuchMethod( - Invocation.method( - #openUrl, - [ - method, - url, - ], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #openUrl, - [ - method, - url, - ], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #openUrl, - [ - method, - url, - ], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> get( - String? host, - int? port, - String? path, - ) => - (super.noSuchMethod( - Invocation.method( - #get, - [ - host, - port, - path, - ], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #get, - [ - host, - port, - path, - ], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #get, - [ - host, - port, - path, - ], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> getUrl(Uri? url) => (super.noSuchMethod( - Invocation.method( - #getUrl, - [url], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #getUrl, - [url], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #getUrl, - [url], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> post( - String? host, - int? port, - String? path, - ) => - (super.noSuchMethod( - Invocation.method( - #post, - [ - host, - port, - path, - ], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #post, - [ - host, - port, - path, - ], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #post, - [ - host, - port, - path, - ], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> postUrl(Uri? url) => (super.noSuchMethod( - Invocation.method( - #postUrl, - [url], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #postUrl, - [url], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #postUrl, - [url], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> put( - String? host, - int? port, - String? path, - ) => - (super.noSuchMethod( - Invocation.method( - #put, - [ - host, - port, - path, - ], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #put, - [ - host, - port, - path, - ], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #put, - [ - host, - port, - path, - ], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> putUrl(Uri? url) => (super.noSuchMethod( - Invocation.method( - #putUrl, - [url], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #putUrl, - [url], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #putUrl, - [url], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> delete( - String? host, - int? port, - String? path, - ) => - (super.noSuchMethod( - Invocation.method( - #delete, - [ - host, - port, - path, - ], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #delete, - [ - host, - port, - path, - ], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #delete, - [ - host, - port, - path, - ], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> deleteUrl(Uri? url) => (super.noSuchMethod( - Invocation.method( - #deleteUrl, - [url], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #deleteUrl, - [url], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #deleteUrl, - [url], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> patch( - String? host, - int? port, - String? path, - ) => - (super.noSuchMethod( - Invocation.method( - #patch, - [ - host, - port, - path, - ], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #patch, - [ - host, - port, - path, - ], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #patch, - [ - host, - port, - path, - ], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> patchUrl(Uri? url) => (super.noSuchMethod( - Invocation.method( - #patchUrl, - [url], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #patchUrl, - [url], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #patchUrl, - [url], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> head( - String? host, - int? port, - String? path, - ) => - (super.noSuchMethod( - Invocation.method( - #head, - [ - host, - port, - path, - ], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #head, - [ - host, - port, - path, - ], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #head, - [ - host, - port, - path, - ], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - _i4.Future<_i2.HttpClientRequest> headUrl(Uri? url) => (super.noSuchMethod( - Invocation.method( - #headUrl, - [url], - ), - returnValue: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #headUrl, - [url], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientRequest>.value(_FakeHttpClientRequest_1( - this, - Invocation.method( - #headUrl, - [url], - ), - )), - ) as _i4.Future<_i2.HttpClientRequest>); - - @override - void addCredentials( - Uri? url, - String? realm, - _i2.HttpClientCredentials? credentials, - ) => - super.noSuchMethod( - Invocation.method( - #addCredentials, - [ - url, - realm, - credentials, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void addProxyCredentials( - String? host, - int? port, - String? realm, - _i2.HttpClientCredentials? credentials, - ) => - super.noSuchMethod( - Invocation.method( - #addProxyCredentials, - [ - host, - port, - realm, - credentials, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void close({bool? force = false}) => super.noSuchMethod( - Invocation.method( - #close, - [], - {#force: force}, - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [HttpClientRequest]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockHttpClientRequest extends _i1.Mock implements _i2.HttpClientRequest { - @override - bool get persistentConnection => (super.noSuchMethod( - Invocation.getter(#persistentConnection), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - set persistentConnection(bool? _persistentConnection) => super.noSuchMethod( - Invocation.setter( - #persistentConnection, - _persistentConnection, - ), - returnValueForMissingStub: null, - ); - - @override - bool get followRedirects => (super.noSuchMethod( - Invocation.getter(#followRedirects), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - set followRedirects(bool? _followRedirects) => super.noSuchMethod( - Invocation.setter( - #followRedirects, - _followRedirects, - ), - returnValueForMissingStub: null, - ); - - @override - int get maxRedirects => (super.noSuchMethod( - Invocation.getter(#maxRedirects), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - set maxRedirects(int? _maxRedirects) => super.noSuchMethod( - Invocation.setter( - #maxRedirects, - _maxRedirects, - ), - returnValueForMissingStub: null, - ); - - @override - int get contentLength => (super.noSuchMethod( - Invocation.getter(#contentLength), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - set contentLength(int? _contentLength) => super.noSuchMethod( - Invocation.setter( - #contentLength, - _contentLength, - ), - returnValueForMissingStub: null, - ); - - @override - bool get bufferOutput => (super.noSuchMethod( - Invocation.getter(#bufferOutput), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - set bufferOutput(bool? _bufferOutput) => super.noSuchMethod( - Invocation.setter( - #bufferOutput, - _bufferOutput, - ), - returnValueForMissingStub: null, - ); - - @override - String get method => (super.noSuchMethod( - Invocation.getter(#method), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#method), - ), - returnValueForMissingStub: _i5.dummyValue( - this, - Invocation.getter(#method), - ), - ) as String); - - @override - Uri get uri => (super.noSuchMethod( - Invocation.getter(#uri), - returnValue: _FakeUri_2( - this, - Invocation.getter(#uri), - ), - returnValueForMissingStub: _FakeUri_2( - this, - Invocation.getter(#uri), - ), - ) as Uri); - - @override - _i2.HttpHeaders get headers => (super.noSuchMethod( - Invocation.getter(#headers), - returnValue: _FakeHttpHeaders_3( - this, - Invocation.getter(#headers), - ), - returnValueForMissingStub: _FakeHttpHeaders_3( - this, - Invocation.getter(#headers), - ), - ) as _i2.HttpHeaders); - - @override - List<_i2.Cookie> get cookies => (super.noSuchMethod( - Invocation.getter(#cookies), - returnValue: <_i2.Cookie>[], - returnValueForMissingStub: <_i2.Cookie>[], - ) as List<_i2.Cookie>); - - @override - _i4.Future<_i2.HttpClientResponse> get done => (super.noSuchMethod( - Invocation.getter(#done), - returnValue: _i4.Future<_i2.HttpClientResponse>.value(_FakeHttpClientResponse_4( - this, - Invocation.getter(#done), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientResponse>.value(_FakeHttpClientResponse_4( - this, - Invocation.getter(#done), - )), - ) as _i4.Future<_i2.HttpClientResponse>); - - @override - _i3.Encoding get encoding => (super.noSuchMethod( - Invocation.getter(#encoding), - returnValue: _FakeEncoding_5( - this, - Invocation.getter(#encoding), - ), - returnValueForMissingStub: _FakeEncoding_5( - this, - Invocation.getter(#encoding), - ), - ) as _i3.Encoding); - - @override - set encoding(_i3.Encoding? _encoding) => super.noSuchMethod( - Invocation.setter( - #encoding, - _encoding, - ), - returnValueForMissingStub: null, - ); - - @override - _i4.Future<_i2.HttpClientResponse> close() => (super.noSuchMethod( - Invocation.method( - #close, - [], - ), - returnValue: _i4.Future<_i2.HttpClientResponse>.value(_FakeHttpClientResponse_4( - this, - Invocation.method( - #close, - [], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientResponse>.value(_FakeHttpClientResponse_4( - this, - Invocation.method( - #close, - [], - ), - )), - ) as _i4.Future<_i2.HttpClientResponse>); - - @override - void abort([ - Object? exception, - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #abort, - [ - exception, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void add(List? data) => super.noSuchMethod( - Invocation.method( - #add, - [data], - ), - returnValueForMissingStub: null, - ); - - @override - void write(Object? object) => super.noSuchMethod( - Invocation.method( - #write, - [object], - ), - returnValueForMissingStub: null, - ); - - @override - void writeAll( - Iterable? objects, [ - String? separator = r'', - ]) => - super.noSuchMethod( - Invocation.method( - #writeAll, - [ - objects, - separator, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void writeln([Object? object = r'']) => super.noSuchMethod( - Invocation.method( - #writeln, - [object], - ), - returnValueForMissingStub: null, - ); - - @override - void writeCharCode(int? charCode) => super.noSuchMethod( - Invocation.method( - #writeCharCode, - [charCode], - ), - returnValueForMissingStub: null, - ); - - @override - void addError( - Object? error, [ - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #addError, - [ - error, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); - - @override - _i4.Future addStream(_i4.Stream>? stream) => (super.noSuchMethod( - Invocation.method( - #addStream, - [stream], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future flush() => (super.noSuchMethod( - Invocation.method( - #flush, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); -} - -/// A class which mocks [HttpClientResponse]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockHttpClientResponse extends _i1.Mock implements _i2.HttpClientResponse { - @override - int get statusCode => (super.noSuchMethod( - Invocation.getter(#statusCode), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - String get reasonPhrase => (super.noSuchMethod( - Invocation.getter(#reasonPhrase), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#reasonPhrase), - ), - returnValueForMissingStub: _i5.dummyValue( - this, - Invocation.getter(#reasonPhrase), - ), - ) as String); - - @override - int get contentLength => (super.noSuchMethod( - Invocation.getter(#contentLength), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - _i2.HttpClientResponseCompressionState get compressionState => (super.noSuchMethod( - Invocation.getter(#compressionState), - returnValue: _i2.HttpClientResponseCompressionState.notCompressed, - returnValueForMissingStub: _i2.HttpClientResponseCompressionState.notCompressed, - ) as _i2.HttpClientResponseCompressionState); - - @override - bool get persistentConnection => (super.noSuchMethod( - Invocation.getter(#persistentConnection), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - bool get isRedirect => (super.noSuchMethod( - Invocation.getter(#isRedirect), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - List<_i2.RedirectInfo> get redirects => (super.noSuchMethod( - Invocation.getter(#redirects), - returnValue: <_i2.RedirectInfo>[], - returnValueForMissingStub: <_i2.RedirectInfo>[], - ) as List<_i2.RedirectInfo>); - - @override - _i2.HttpHeaders get headers => (super.noSuchMethod( - Invocation.getter(#headers), - returnValue: _FakeHttpHeaders_3( - this, - Invocation.getter(#headers), - ), - returnValueForMissingStub: _FakeHttpHeaders_3( - this, - Invocation.getter(#headers), - ), - ) as _i2.HttpHeaders); - - @override - List<_i2.Cookie> get cookies => (super.noSuchMethod( - Invocation.getter(#cookies), - returnValue: <_i2.Cookie>[], - returnValueForMissingStub: <_i2.Cookie>[], - ) as List<_i2.Cookie>); - - @override - bool get isBroadcast => (super.noSuchMethod( - Invocation.getter(#isBroadcast), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - _i4.Future get length => (super.noSuchMethod( - Invocation.getter(#length), - returnValue: _i4.Future.value(0), - returnValueForMissingStub: _i4.Future.value(0), - ) as _i4.Future); - - @override - _i4.Future get isEmpty => (super.noSuchMethod( - Invocation.getter(#isEmpty), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); - - @override - _i4.Future> get first => (super.noSuchMethod( - Invocation.getter(#first), - returnValue: _i4.Future>.value([]), - returnValueForMissingStub: _i4.Future>.value([]), - ) as _i4.Future>); - - @override - _i4.Future> get last => (super.noSuchMethod( - Invocation.getter(#last), - returnValue: _i4.Future>.value([]), - returnValueForMissingStub: _i4.Future>.value([]), - ) as _i4.Future>); - - @override - _i4.Future> get single => (super.noSuchMethod( - Invocation.getter(#single), - returnValue: _i4.Future>.value([]), - returnValueForMissingStub: _i4.Future>.value([]), - ) as _i4.Future>); - - @override - _i4.Future<_i2.HttpClientResponse> redirect([ - String? method, - Uri? url, - bool? followLoops, - ]) => - (super.noSuchMethod( - Invocation.method( - #redirect, - [ - method, - url, - followLoops, - ], - ), - returnValue: _i4.Future<_i2.HttpClientResponse>.value(_FakeHttpClientResponse_4( - this, - Invocation.method( - #redirect, - [ - method, - url, - followLoops, - ], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.HttpClientResponse>.value(_FakeHttpClientResponse_4( - this, - Invocation.method( - #redirect, - [ - method, - url, - followLoops, - ], - ), - )), - ) as _i4.Future<_i2.HttpClientResponse>); - - @override - _i4.Future<_i2.Socket> detachSocket() => (super.noSuchMethod( - Invocation.method( - #detachSocket, - [], - ), - returnValue: _i4.Future<_i2.Socket>.value(_FakeSocket_6( - this, - Invocation.method( - #detachSocket, - [], - ), - )), - returnValueForMissingStub: _i4.Future<_i2.Socket>.value(_FakeSocket_6( - this, - Invocation.method( - #detachSocket, - [], - ), - )), - ) as _i4.Future<_i2.Socket>); - - @override - _i4.Stream> asBroadcastStream({ - void Function(_i4.StreamSubscription>)? onListen, - void Function(_i4.StreamSubscription>)? onCancel, - }) => - (super.noSuchMethod( - Invocation.method( - #asBroadcastStream, - [], - { - #onListen: onListen, - #onCancel: onCancel, - }, - ), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); - - @override - _i4.StreamSubscription> listen( - void Function(List)? onData, { - Function? onError, - void Function()? onDone, - bool? cancelOnError, - }) => - (super.noSuchMethod( - Invocation.method( - #listen, - [onData], - { - #onError: onError, - #onDone: onDone, - #cancelOnError: cancelOnError, - }, - ), - returnValue: _FakeStreamSubscription_7>( - this, - Invocation.method( - #listen, - [onData], - { - #onError: onError, - #onDone: onDone, - #cancelOnError: cancelOnError, - }, - ), - ), - returnValueForMissingStub: _FakeStreamSubscription_7>( - this, - Invocation.method( - #listen, - [onData], - { - #onError: onError, - #onDone: onDone, - #cancelOnError: cancelOnError, - }, - ), - ), - ) as _i4.StreamSubscription>); - - @override - _i4.Stream> where(bool Function(List)? test) => (super.noSuchMethod( - Invocation.method( - #where, - [test], - ), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); - - @override - _i4.Stream map(S Function(List)? convert) => (super.noSuchMethod( - Invocation.method( - #map, - [convert], - ), - returnValue: _i4.Stream.empty(), - returnValueForMissingStub: _i4.Stream.empty(), - ) as _i4.Stream); - - @override - _i4.Stream asyncMap(_i4.FutureOr Function(List)? convert) => (super.noSuchMethod( - Invocation.method( - #asyncMap, - [convert], - ), - returnValue: _i4.Stream.empty(), - returnValueForMissingStub: _i4.Stream.empty(), - ) as _i4.Stream); - - @override - _i4.Stream asyncExpand(_i4.Stream? Function(List)? convert) => (super.noSuchMethod( - Invocation.method( - #asyncExpand, - [convert], - ), - returnValue: _i4.Stream.empty(), - returnValueForMissingStub: _i4.Stream.empty(), - ) as _i4.Stream); - - @override - _i4.Stream> handleError( - Function? onError, { - bool Function(dynamic)? test, - }) => - (super.noSuchMethod( - Invocation.method( - #handleError, - [onError], - {#test: test}, - ), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); - - @override - _i4.Stream expand(Iterable Function(List)? convert) => (super.noSuchMethod( - Invocation.method( - #expand, - [convert], - ), - returnValue: _i4.Stream.empty(), - returnValueForMissingStub: _i4.Stream.empty(), - ) as _i4.Stream); - - @override - _i4.Future pipe(_i4.StreamConsumer>? streamConsumer) => (super.noSuchMethod( - Invocation.method( - #pipe, - [streamConsumer], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Stream transform(_i4.StreamTransformer, S>? streamTransformer) => (super.noSuchMethod( - Invocation.method( - #transform, - [streamTransformer], - ), - returnValue: _i4.Stream.empty(), - returnValueForMissingStub: _i4.Stream.empty(), - ) as _i4.Stream); - - @override - _i4.Future> reduce( - List Function( - List, - List, - )? combine) => - (super.noSuchMethod( - Invocation.method( - #reduce, - [combine], - ), - returnValue: _i4.Future>.value([]), - returnValueForMissingStub: _i4.Future>.value([]), - ) as _i4.Future>); - - @override - _i4.Future fold( - S? initialValue, - S Function( - S, - List, - )? combine, - ) => - (super.noSuchMethod( - Invocation.method( - #fold, - [ - initialValue, - combine, - ], - ), - returnValue: _i5.ifNotNull( - _i5.dummyValueOrNull( - this, - Invocation.method( - #fold, - [ - initialValue, - combine, - ], - ), - ), - (S v) => _i4.Future.value(v), - ) ?? - _FakeFuture_8( - this, - Invocation.method( - #fold, - [ - initialValue, - combine, - ], - ), - ), - returnValueForMissingStub: _i5.ifNotNull( - _i5.dummyValueOrNull( - this, - Invocation.method( - #fold, - [ - initialValue, - combine, - ], - ), - ), - (S v) => _i4.Future.value(v), - ) ?? - _FakeFuture_8( - this, - Invocation.method( - #fold, - [ - initialValue, - combine, - ], - ), - ), - ) as _i4.Future); - - @override - _i4.Future join([String? separator = r'']) => (super.noSuchMethod( - Invocation.method( - #join, - [separator], - ), - returnValue: _i4.Future.value(_i5.dummyValue( - this, - Invocation.method( - #join, - [separator], - ), - )), - returnValueForMissingStub: _i4.Future.value(_i5.dummyValue( - this, - Invocation.method( - #join, - [separator], - ), - )), - ) as _i4.Future); - - @override - _i4.Future contains(Object? needle) => (super.noSuchMethod( - Invocation.method( - #contains, - [needle], - ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); - - @override - _i4.Future forEach(void Function(List)? action) => (super.noSuchMethod( - Invocation.method( - #forEach, - [action], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future every(bool Function(List)? test) => (super.noSuchMethod( - Invocation.method( - #every, - [test], - ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); - - @override - _i4.Future any(bool Function(List)? test) => (super.noSuchMethod( - Invocation.method( - #any, - [test], - ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); - - @override - _i4.Stream cast() => (super.noSuchMethod( - Invocation.method( - #cast, - [], - ), - returnValue: _i4.Stream.empty(), - returnValueForMissingStub: _i4.Stream.empty(), - ) as _i4.Stream); - - @override - _i4.Future>> toList() => (super.noSuchMethod( - Invocation.method( - #toList, - [], - ), - returnValue: _i4.Future>>.value(>[]), - returnValueForMissingStub: _i4.Future>>.value(>[]), - ) as _i4.Future>>); - - @override - _i4.Future>> toSet() => (super.noSuchMethod( - Invocation.method( - #toSet, - [], - ), - returnValue: _i4.Future>>.value(>{}), - returnValueForMissingStub: _i4.Future>>.value(>{}), - ) as _i4.Future>>); - - @override - _i4.Future drain([E? futureValue]) => (super.noSuchMethod( - Invocation.method( - #drain, - [futureValue], - ), - returnValue: _i5.ifNotNull( - _i5.dummyValueOrNull( - this, - Invocation.method( - #drain, - [futureValue], - ), - ), - (E v) => _i4.Future.value(v), - ) ?? - _FakeFuture_8( - this, - Invocation.method( - #drain, - [futureValue], - ), - ), - returnValueForMissingStub: _i5.ifNotNull( - _i5.dummyValueOrNull( - this, - Invocation.method( - #drain, - [futureValue], - ), - ), - (E v) => _i4.Future.value(v), - ) ?? - _FakeFuture_8( - this, - Invocation.method( - #drain, - [futureValue], - ), - ), - ) as _i4.Future); - - @override - _i4.Stream> take(int? count) => (super.noSuchMethod( - Invocation.method( - #take, - [count], - ), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); - - @override - _i4.Stream> takeWhile(bool Function(List)? test) => (super.noSuchMethod( - Invocation.method( - #takeWhile, - [test], - ), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); - - @override - _i4.Stream> skip(int? count) => (super.noSuchMethod( - Invocation.method( - #skip, - [count], - ), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); - - @override - _i4.Stream> skipWhile(bool Function(List)? test) => (super.noSuchMethod( - Invocation.method( - #skipWhile, - [test], - ), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); - - @override - _i4.Stream> distinct( - [bool Function( - List, - List, - )? equals]) => - (super.noSuchMethod( - Invocation.method( - #distinct, - [equals], - ), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); - - @override - _i4.Future> firstWhere( - bool Function(List)? test, { - List Function()? orElse, - }) => - (super.noSuchMethod( - Invocation.method( - #firstWhere, - [test], - {#orElse: orElse}, - ), - returnValue: _i4.Future>.value([]), - returnValueForMissingStub: _i4.Future>.value([]), - ) as _i4.Future>); - - @override - _i4.Future> lastWhere( - bool Function(List)? test, { - List Function()? orElse, - }) => - (super.noSuchMethod( - Invocation.method( - #lastWhere, - [test], - {#orElse: orElse}, - ), - returnValue: _i4.Future>.value([]), - returnValueForMissingStub: _i4.Future>.value([]), - ) as _i4.Future>); - - @override - _i4.Future> singleWhere( - bool Function(List)? test, { - List Function()? orElse, - }) => - (super.noSuchMethod( - Invocation.method( - #singleWhere, - [test], - {#orElse: orElse}, - ), - returnValue: _i4.Future>.value([]), - returnValueForMissingStub: _i4.Future>.value([]), - ) as _i4.Future>); - - @override - _i4.Future> elementAt(int? index) => (super.noSuchMethod( - Invocation.method( - #elementAt, - [index], - ), - returnValue: _i4.Future>.value([]), - returnValueForMissingStub: _i4.Future>.value([]), - ) as _i4.Future>); - - @override - _i4.Stream> timeout( - Duration? timeLimit, { - void Function(_i4.EventSink>)? onTimeout, - }) => - (super.noSuchMethod( - Invocation.method( - #timeout, - [timeLimit], - {#onTimeout: onTimeout}, - ), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); -} - -/// A class which mocks [HttpHeaders]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockHttpHeaders extends _i1.Mock implements _i2.HttpHeaders { - @override - set date(DateTime? _date) => super.noSuchMethod( - Invocation.setter( - #date, - _date, - ), - returnValueForMissingStub: null, - ); - - @override - set expires(DateTime? _expires) => super.noSuchMethod( - Invocation.setter( - #expires, - _expires, - ), - returnValueForMissingStub: null, - ); - - @override - set ifModifiedSince(DateTime? _ifModifiedSince) => super.noSuchMethod( - Invocation.setter( - #ifModifiedSince, - _ifModifiedSince, - ), - returnValueForMissingStub: null, - ); - - @override - set host(String? _host) => super.noSuchMethod( - Invocation.setter( - #host, - _host, - ), - returnValueForMissingStub: null, - ); - - @override - set port(int? _port) => super.noSuchMethod( - Invocation.setter( - #port, - _port, - ), - returnValueForMissingStub: null, - ); - - @override - set contentType(_i2.ContentType? _contentType) => super.noSuchMethod( - Invocation.setter( - #contentType, - _contentType, - ), - returnValueForMissingStub: null, - ); - - @override - int get contentLength => (super.noSuchMethod( - Invocation.getter(#contentLength), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - set contentLength(int? _contentLength) => super.noSuchMethod( - Invocation.setter( - #contentLength, - _contentLength, - ), - returnValueForMissingStub: null, - ); - - @override - bool get persistentConnection => (super.noSuchMethod( - Invocation.getter(#persistentConnection), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - set persistentConnection(bool? _persistentConnection) => super.noSuchMethod( - Invocation.setter( - #persistentConnection, - _persistentConnection, - ), - returnValueForMissingStub: null, - ); - - @override - bool get chunkedTransferEncoding => (super.noSuchMethod( - Invocation.getter(#chunkedTransferEncoding), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - set chunkedTransferEncoding(bool? _chunkedTransferEncoding) => super.noSuchMethod( - Invocation.setter( - #chunkedTransferEncoding, - _chunkedTransferEncoding, - ), - returnValueForMissingStub: null, - ); - - @override - List? operator [](String? name) => (super.noSuchMethod( - Invocation.method( - #[], - [name], - ), - returnValueForMissingStub: null, - ) as List?); - - @override - String? value(String? name) => (super.noSuchMethod( - Invocation.method( - #value, - [name], - ), - returnValueForMissingStub: null, - ) as String?); - - @override - void add( - String? name, - Object? value, { - bool? preserveHeaderCase = false, - }) => - super.noSuchMethod( - Invocation.method( - #add, - [ - name, - value, - ], - {#preserveHeaderCase: preserveHeaderCase}, - ), - returnValueForMissingStub: null, - ); - - @override - void set( - String? name, - Object? value, { - bool? preserveHeaderCase = false, - }) => - super.noSuchMethod( - Invocation.method( - #set, - [ - name, - value, - ], - {#preserveHeaderCase: preserveHeaderCase}, - ), - returnValueForMissingStub: null, - ); - - @override - void remove( - String? name, - Object? value, - ) => - super.noSuchMethod( - Invocation.method( - #remove, - [ - name, - value, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void removeAll(String? name) => super.noSuchMethod( - Invocation.method( - #removeAll, - [name], - ), - returnValueForMissingStub: null, - ); - - @override - void forEach( - void Function( - String, - List, - )? action) => - super.noSuchMethod( - Invocation.method( - #forEach, - [action], - ), - returnValueForMissingStub: null, - ); - - @override - void noFolding(String? name) => super.noSuchMethod( - Invocation.method( - #noFolding, - [name], - ), - returnValueForMissingStub: null, - ); - - @override - void clear() => super.noSuchMethod( - Invocation.method( - #clear, - [], - ), - returnValueForMissingStub: null, - ); -} diff --git a/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart b/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart index dbcbe28a8c6..cc09ce8382c 100644 --- a/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart +++ b/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart @@ -1,198 +1,234 @@ -// ignore_for_file: discarded_futures - import 'dart:convert'; import 'package:built_collection/built_collection.dart'; import 'package:built_value/json_object.dart'; import 'package:dynamite_end_to_end_test/parameters.openapi.dart'; import 'package:dynamite_runtime/models.dart'; -import 'package:mockito/mockito.dart'; +import 'package:http/http.dart'; +import 'package:http/testing.dart'; import 'package:test/test.dart'; -import 'package:universal_io/io.dart'; - -import 'http_client_mock.mocks.dart'; - -late MockHttpClient mockHttpClient; - -class MockHttpOverrides extends HttpOverrides { - @override - HttpClient createHttpClient(SecurityContext? context) => mockHttpClient; -} void main() { - late $Client client; - late MockHttpHeaders headers; - late MockHttpClientResponse response; - late MockHttpClientRequest request; - - setUp(() { - mockHttpClient = MockHttpClient(); - HttpOverrides.global = MockHttpOverrides(); - - when(mockHttpClient.openUrl(any, any)).thenAnswer((invocation) { - headers = MockHttpHeaders(); - - response = MockHttpClientResponse(); - when(response.headers).thenReturn(headers); - when(response.transform(any)).thenAnswer((_) => Stream.value('{}')); - when(response.statusCode).thenReturn(200); - - request = MockHttpClientRequest(); - when(request.headers).thenReturn(headers); - when(request.close()).thenAnswer((_) async => response); - return Future.value(request); - }); - - client = $Client(Uri.parse('example.com')); - }); + final uri = Uri.parse('example.com'); group(r'$get', () { test('no parameters', () async { + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + + return Response('{}', 200); + }), + ); await client.$get(); - final captured = verify(headers.add(captureAny, captureAny)).captured; - expect(captured, equals(['Accept', 'application/json'])); }); test('with contentString', () async { final contentString = ContentString>( (b) => b..content = BuiltMap({'key': JsonObject('value')}), ); - final queryComponent = Uri.encodeQueryComponent(json.encode({'key': 'value'})); - await client.$get(contentString: contentString); - final captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/?content_string=$queryComponent'), - ]), + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect(request.url, equals(Uri.parse('example.com/?content_string=$queryComponent'))); + + return Response('{}', 200); + }), ); + await client.$get(contentString: contentString); }); test('with contentParameter', () async { final contentParameter = ContentString>( (b) => b..content = BuiltMap({'key': JsonObject('value')}), ); - final queryComponent = Uri.encodeQueryComponent(json.encode({'key': 'value'})); - await client.$get(contentParameter: contentParameter); - final captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/?content_parameter=$queryComponent'), - ]), + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect(request.url, equals(Uri.parse('example.com/?content_parameter=$queryComponent'))); + + return Response('{}', 200); + }), ); + await client.$get(contentParameter: contentParameter); }); test('with empty string', () async { - await client.$get(string: ''); - final captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/?string='), - ]), + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect(request.url, equals(Uri.parse('example.com/?string='))); + + return Response('{}', 200); + }), ); + + await client.$get(string: ''); }); test('with multiple query parameters', () async { final contentString = ContentString>( (b) => b..content = BuiltMap({'key': JsonObject('value')}), ); - final queryComponent = Uri.encodeQueryComponent(json.encode({'key': 'value'})); - await client.$get(contentString: contentString, contentParameter: contentString); - final captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/?content_string=$queryComponent&content_parameter=$queryComponent'), - ]), + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect( + request.url, + equals(Uri.parse('example.com/?content_string=$queryComponent&content_parameter=$queryComponent')), + ); + + return Response('{}', 200); + }), ); + await client.$get(contentString: contentString, contentParameter: contentString); }); + test('oneOf', () async { - await client.$get(oneOf: ($bool: true, string: null)); - var captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/?oneOf=true'), - ]), + var client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect(request.url, equals(Uri.parse('example.com/?oneOf=true'))); + + return Response('{}', 200); + }), ); - resetMockitoState(); + await client.$get(oneOf: ($bool: true, string: null)); - await client.$get(oneOf: ($bool: null, string: 'value')); - captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/?oneOf=value'), - ]), + client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect(request.url, equals(Uri.parse('example.com/?oneOf=value'))); + + return Response('{}', 200); + }), ); + await client.$get(oneOf: ($bool: null, string: 'value')); }); test('anyOf', () async { - await client.$get(anyOf: ($bool: true, string: null)); - var captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/?anyOf=true'), - ]), + var client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect(request.url, equals(Uri.parse('example.com/?anyOf=true'))); + + return Response('{}', 200); + }), ); - resetMockitoState(); + await client.$get(anyOf: ($bool: true, string: null)); - await client.$get(anyOf: ($bool: null, string: 'value')); - captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/?anyOf=value'), - ]), + client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect(request.url, equals(Uri.parse('example.com/?anyOf=value'))); + + return Response('{}', 200); + }), ); - resetMockitoState(); + await client.$get(anyOf: ($bool: null, string: 'value')); - await client.$get(anyOf: ($bool: true, string: 'value')); - captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/?anyOf=true'), - ]), + client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect(request.url, equals(Uri.parse('example.com/?anyOf=true'))); + + return Response('{}', 200); + }), ); + await client.$get(anyOf: ($bool: true, string: 'value')); }); }); group('getHeaders', () { test('no parameters', () async { - await client.getHeaders(); - final captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/headers'), - ]), + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect( + request.url, + equals(Uri.parse('example.com/headers')), + ); + + return Response('{}', 200); + }), ); - - final capturedHeaders = verify(headers.add(captureAny, captureAny)).captured; - expect(capturedHeaders, ['Accept', 'application/json']); + await client.getHeaders(); }); test('all parameters', () async { + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect( + request.headers, + equals({ + 'Accept': 'application/json', + 'content_string': '{"key":"value"}', + 'content_parameter': '{"key":"value"}', + 'array': r'107,0.20416125852587397,false,Value$', + 'array_string': r'Value1,Value2,Value$', + 'bool': 'false', + 'string': r'$String', + 'string_binary': 'U3RyaW5nVmFsdWU=', + 'int': '126', + 'double': '0.5370671089544252', + 'num': '107', + 'object': '0.20416125852587397', + 'oneOf': r'$String', + 'anyOf': 'false', + 'enum_pattern': 'a', + }), + ); + expect(request.method, equalsIgnoringCase('get')); + expect( + request.url, + equals(Uri.parse('example.com/headers')), + ); + + return Response('{}', 200); + }), + ); + await client.getHeaders( contentString: ContentString>( (b) => b..content = BuiltMap({'key': JsonObject('value')}), @@ -222,64 +258,68 @@ void main() { anyOf: ($bool: false, string: r'$String'), enumPattern: GetHeadersEnumPattern.a, ); - - var captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/headers'), - ]), - ); - - captured = verify(headers.add(captureAny, captureAny)).captured; - final capturedHeaders = {}; - for (var i = 0; i < captured.length; i += 2) { - capturedHeaders[captured[i]] = captured[i + 1]; - } - - expect(capturedHeaders, { - 'Accept': 'application/json', - 'content_string': '{"key":"value"}', - 'content_parameter': '{"key":"value"}', - 'array': r'107,0.20416125852587397,false,Value$', - 'array_string': r'Value1,Value2,Value$', - 'bool': 'false', - 'string': r'$String', - 'string_binary': 'U3RyaW5nVmFsdWU=', - 'int': '126', - 'double': '0.5370671089544252', - 'num': '107', - 'object': '0.20416125852587397', - 'oneOf': r'$String', - 'anyOf': 'false', - 'enum_pattern': 'a', - }); }); }); group('getPathParameter', () { test('empty path', () async { - await client.getPathParameter(pathParameter: 'parameter'); - final captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - expect( - captured, - equals([ - 'get', - Uri.parse('example.com/parameter'), - ]), + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + expect(request.url, equals(Uri.parse('example.com/parameter'))); + + return Response('{}', 200); + }), ); + await client.getPathParameter(pathParameter: 'parameter'); }); }); group('PatternCheck', () { test('enum', () async { + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect(request.headers, equals({'Accept': 'application/json'})); + expect(request.method, equalsIgnoringCase('get')); + + return Response('{}', 200); + }), + ); expect(() => client.$get(enumPattern: GetEnumPattern.$0), throwsA(isA())); expect(() => client.getHeaders(enumPattern: GetHeadersEnumPattern.$0), throwsA(isA())); }); }); test('Naming Collisions', () async { + final client = $Client( + uri, + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + expect( + request.headers, + equals({ + 'Accept': 'application/json', + '%24serializers': r'serializers$ value', + '_body': r'$body value', + '_parameters': r'parameters value$$$', + '_headers': r'headers$', + }), + ); + expect(request.method, equalsIgnoringCase('get')); + expect( + request.url, + equals(Uri.parse('example.com/naming_collisions?%24jsonSerializers=jsonSerializers%20value%24')), + ); + + return Response('{}', 200); + }), + ); + await client.getNamingCollisions( jsonSerializers: r'jsonSerializers value$', serializers: r'serializers$ value', @@ -287,28 +327,5 @@ void main() { parameters: r'parameters value$$$', headers: r'headers$', ); - - final captured = verify(headers.add(captureAny, captureAny)).captured; - final capturedHeaders = {}; - for (var i = 0; i < captured.length; i += 2) { - capturedHeaders[captured[i]] = captured[i + 1]; - } - final capturedUrl = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; - - expect(capturedHeaders, { - 'Accept': 'application/json', - '%24serializers': r'serializers$ value', - '_body': r'$body value', - '_parameters': r'parameters value$$$', - '_headers': r'headers$', - }); - - expect( - capturedUrl, - equals([ - 'get', - Uri.parse('example.com/naming_collisions?%24jsonSerializers=jsonSerializers%20value%24'), - ]), - ); }); } diff --git a/packages/dynamite/dynamite_end_to_end_test/test/request_body_test.dart b/packages/dynamite/dynamite_end_to_end_test/test/request_body_test.dart index a8a2843c424..2a04ebdfb3f 100644 --- a/packages/dynamite/dynamite_end_to_end_test/test/request_body_test.dart +++ b/packages/dynamite/dynamite_end_to_end_test/test/request_body_test.dart @@ -1,68 +1,53 @@ -// ignore_for_file: discarded_futures - import 'dart:convert'; import 'package:dynamite_end_to_end_test/request_body.openapi.dart'; -import 'package:mockito/mockito.dart'; +import 'package:http/http.dart'; +import 'package:http/testing.dart'; import 'package:test/test.dart'; -import 'package:universal_io/io.dart'; - -import 'http_client_mock.mocks.dart'; - -late MockHttpClient mockHttpClient; - -class MockHttpOverrides extends HttpOverrides { - @override - HttpClient createHttpClient(SecurityContext? context) => mockHttpClient; -} - -void main() { - late $Client client; - late MockHttpHeaders headers; - late MockHttpClientResponse response; - late MockHttpClientRequest request; - - setUp(() { - mockHttpClient = MockHttpClient(); - HttpOverrides.global = MockHttpOverrides(); - - when(mockHttpClient.openUrl(any, any)).thenAnswer((invocation) { - headers = MockHttpHeaders(); - - response = MockHttpClientResponse(); - when(response.headers).thenReturn(headers); - when(response.transform(any)).thenAnswer((_) => Stream.value('{}')); - when(response.statusCode).thenReturn(200); - - request = MockHttpClientRequest(); - when(request.headers).thenReturn(headers); - when(request.close()).thenAnswer((_) async => response); - return Future.value(request); - }); - - client = $Client(Uri.parse('example.com')); - }); +void main() async { test('Request Uint8List body', () async { // No body + var client = $Client( + Uri.parse('example.com'), + httpClient: MockClient((request) async { + expect(request.bodyBytes.length, 0); + return Response('{}', 200); + }), + ); await client.$get(); - verifyNever(request.add(captureAny)); // with body final data = utf8.encode('value'); + client = $Client( + Uri.parse('example.com'), + httpClient: MockClient((request) async { + expect(request.bodyBytes, equals(data)); + return Response('{}', 200); + }), + ); await client.$get(uint8List: data); - final captured = verify(request.add(captureAny)).captured; - expect(captured, [data]); }); test('Request String body', () async { // No body + var client = $Client( + Uri.parse('example.com'), + httpClient: MockClient((request) async { + expect(request.body, isEmpty); + return Response('{}', 200); + }), + ); await client.post(); - verifyNever(request.add(captureAny)); // with body + client = $Client( + Uri.parse('example.com'), + httpClient: MockClient((request) async { + expect(request.bodyBytes, utf8.encode('value')); + return Response('{}', 200); + }), + ); await client.post(string: 'value'); - final captured = verify(request.add(captureAny)).captured; - expect(captured, [utf8.encode('value')]); }); } diff --git a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart index 454d4ed6256..8894f6b85a9 100644 --- a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart +++ b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart @@ -6,8 +6,8 @@ import 'package:built_value/serializer.dart'; import 'package:cookie_jar/cookie_jar.dart'; import 'package:dynamite_runtime/src/http_extensions.dart'; import 'package:dynamite_runtime/src/utils/uri.dart'; +import 'package:http/http.dart' as http; import 'package:meta/meta.dart'; -import 'package:universal_io/io.dart'; /// Response returned by operations of a [DynamiteClient]. /// @@ -62,7 +62,7 @@ class DynamiteRawResponse { /// After [future] completes the deserialized response can be accessed /// through [response]. DynamiteRawResponse({ - required Future response, + required Future response, required this.bodyType, required this.headersType, required this.serializers, @@ -73,13 +73,13 @@ class DynamiteRawResponse { // ignore: discarded_futures response.then( (response) async { - _rawHeaders = response.responseHeaders; + _rawHeaders = response.headers; final headers = deserializeHeaders(_rawHeaders, serializers, headersType); _rawBody = switch (bodyType) { - const FullType(Uint8List) => await response.bytes, - const FullType(String) => await response.string, - _ => await response.json, + const FullType(Uint8List) => await response.stream.bytes, + const FullType(String) => await response.stream.string, + _ => await response.stream.json, }; final body = deserializeBody(_rawBody, serializers, bodyType); @@ -267,17 +267,17 @@ class DynamiteApiException implements Exception { /// Creates a new Exception from the given [response]. /// /// Tries to decode the `response` into a string. - static Future fromResponse(HttpClientResponse response) async { + static Future fromResponse(http.StreamedResponse response) async { String body; try { - body = await response.string; + body = await response.stream.string; } on FormatException { body = 'binary'; } return DynamiteApiException( response.statusCode, - response.responseHeaders, + response.headers, body, ); } @@ -377,11 +377,11 @@ class DynamiteClient { DynamiteClient( Uri baseURL, { this.baseHeaders, - String? userAgent, - HttpClient? httpClient, + this.userAgent, + http.Client? httpClient, this.cookieJar, this.authentications = const [], - }) : httpClient = (httpClient ?? HttpClient())..userAgent = userAgent, + }) : httpClient = httpClient ?? http.Client(), baseURL = baseURL.normalizeEmptyPath() { if (baseURL.queryParametersAll.isNotEmpty) { throw UnsupportedError('Dynamite can not work with a baseURL containing query parameters.'); @@ -397,8 +397,11 @@ class DynamiteClient { /// The base headers added to each request. final Map? baseHeaders; + /// The value sent in the `user-agent` header. + final String? userAgent; + /// The base http client. - final HttpClient httpClient; + final http.Client httpClient; /// The optional cookie jar to persist the response cookies. final CookieJar? cookieJar; @@ -413,7 +416,7 @@ class DynamiteClient { /// The query parameters of the [baseURL] are added. /// The [path] is resolved against the path of the [baseURL]. /// All [baseHeaders] are added to the request. - Future executeRequest( + Future executeRequest( String method, String path, Map headers, @@ -425,33 +428,42 @@ class DynamiteClient { return executeRawRequest( method, uri, - {...?baseHeaders, ...headers}, + { + if (userAgent != null) 'user-agent': userAgent!, + ...?baseHeaders, + ...headers, + }, body, validStatuses, ); } /// Executes a HTTP request against give full [uri]. - Future executeRawRequest( + Future executeRawRequest( String method, Uri uri, Map headers, Uint8List? body, Set? validStatuses, ) async { - final request = await httpClient.openUrl(method, uri); + final request = http.Request(method, uri); request.headers.addAll(headers); if (body != null) { - request.add(body); + request.bodyBytes = body; } + if (cookieJar != null) { - request.cookies.addAll(await cookieJar!.loadForRequest(uri)); + final cookies = await cookieJar!.loadForRequest(uri); + request.headers['cookie'] = cookies.join('; '); } - final response = await request.close(); - if (cookieJar != null) { - await cookieJar!.saveFromResponse(uri, response.cookies); + final response = await httpClient.send(request); + + final cookieHeader = response.headersSplitValues['set-cookie']; + if (cookieHeader != null && cookieJar != null) { + final cookies = cookieHeader.map(Cookie.fromSetCookieValue).toList(); + await cookieJar!.saveFromResponse(uri, cookies); } if (validStatuses?.contains(response.statusCode) ?? true) { diff --git a/packages/dynamite/dynamite_runtime/lib/src/http_extensions.dart b/packages/dynamite/dynamite_runtime/lib/src/http_extensions.dart index f2bfe1f41c4..c9d14b469ff 100644 --- a/packages/dynamite/dynamite_runtime/lib/src/http_extensions.dart +++ b/packages/dynamite/dynamite_runtime/lib/src/http_extensions.dart @@ -3,7 +3,6 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:meta/meta.dart'; -import 'package:universal_io/io.dart'; import 'package:xml/xml.dart'; import 'package:xml/xml_events.dart'; @@ -51,26 +50,3 @@ extension BytesStreamExtension on BytesStream { return element as XmlElement; } } - -/// Extension on a http responses. -extension HttpClientResponseExtension on HttpClientResponse { - /// Returns a map of headers. - Map get responseHeaders { - final responseHeaders = {}; - headers.forEach((name, values) { - responseHeaders[name] = values.last; - }); - - return responseHeaders; - } -} - -/// Extension for http headers. -extension HttpHeadersExtension on HttpHeaders { - /// Iteratively adds all header values. - void addAll(Map headers) { - for (final header in headers.entries) { - add(header.key, header.value); - } - } -} diff --git a/packages/dynamite/dynamite_runtime/pubspec.yaml b/packages/dynamite/dynamite_runtime/pubspec.yaml index cb39043f0fa..c41861f1f29 100644 --- a/packages/dynamite/dynamite_runtime/pubspec.yaml +++ b/packages/dynamite/dynamite_runtime/pubspec.yaml @@ -16,14 +16,13 @@ dependencies: built_value: ^8.0.1 collection: ^1.0.0 cookie_jar: ^4.0.7 + http: ^1.2.0 meta: ^1.0.0 - universal_io: ^2.0.0 xml: ^6.0.0 dev_dependencies: build_runner: ^2.4.8 built_value_generator: ^8.8.1 - mocktail: ^1.0.2 neon_lints: git: url: https://github.com/nextcloud/neon diff --git a/packages/dynamite/dynamite_runtime/test/client_test.dart b/packages/dynamite/dynamite_runtime/test/client_test.dart index e96b6677988..3b8e910f3c2 100644 --- a/packages/dynamite/dynamite_runtime/test/client_test.dart +++ b/packages/dynamite/dynamite_runtime/test/client_test.dart @@ -1,64 +1,37 @@ import 'package:dynamite_runtime/http_client.dart'; -import 'package:mocktail/mocktail.dart'; +import 'package:http/http.dart'; +import 'package:http/testing.dart'; import 'package:test/test.dart'; -import 'package:universal_io/io.dart'; - -class MockHttpClient extends Mock implements HttpClient {} - -class MockHttpRequest extends Mock implements HttpClientRequest { - MockHttpRequest(this.response); - - final MockHttpResponse response; - - @override - final cookies = []; - - @override - final headers = MockHttpHeaders(); - - @override - Future close() async => response; -} - -class MockHttpHeaders extends Mock implements HttpHeaders {} - -class MockHttpResponse extends Mock implements HttpClientResponse { - MockHttpResponse(this.cookies); - - @override - final List cookies; -} void main() { final uri = Uri.parse('http://example.com'); late CookieJar cookieJar; - late HttpClient httpClient; - late DynamiteClient client; - - setUpAll(() { - registerFallbackValue(Uri()); - }); setUp(() { cookieJar = CookieJar(); - httpClient = MockHttpClient(); - client = DynamiteClient( + }); + + test('Cookies', () async { + final mockedClient = MockClient((request) async { + expect(request.headers['cookie'], equals(Cookie('a', 'b').toString())); + + return Response( + '', + 200, + headers: { + 'set-cookie': Cookie('c', 'd').toString(), + }, + ); + }); + + final client = DynamiteClient( uri, - httpClient: httpClient, + httpClient: mockedClient, cookieJar: cookieJar, ); - }); - test('Cookies', () async { await cookieJar.saveFromResponse(uri, [Cookie('a', 'b')]); - // ignore: close_sinks - final mockRequest = MockHttpRequest(MockHttpResponse([Cookie('c', 'd')])); - when(() => httpClient.openUrl(any(), any())).thenAnswer((_) => Future.value(mockRequest)); - await client.executeRequest('GET', '', {}, null, null); - expect(mockRequest.cookies, hasLength(1)); - expect(mockRequest.cookies[0].name, 'a'); - expect(mockRequest.cookies[0].value, 'b'); final cookies = await cookieJar.loadForRequest(uri); expect(cookies, hasLength(2)); diff --git a/packages/neon_framework/lib/src/widgets/image.dart b/packages/neon_framework/lib/src/widgets/image.dart index 0b770d65997..cd45b89a484 100644 --- a/packages/neon_framework/lib/src/widgets/image.dart +++ b/packages/neon_framework/lib/src/widgets/image.dart @@ -381,7 +381,7 @@ class NeonUrlImage extends StatelessWidget { const {200}, ); - return response.bytes; + return response.stream.bytes; }, cacheKey: '${account.id}-$url', reviver: reviver, diff --git a/packages/nextcloud/lib/src/webdav/client.dart b/packages/nextcloud/lib/src/webdav/client.dart index 595e8f2c153..85c218301fe 100644 --- a/packages/nextcloud/lib/src/webdav/client.dart +++ b/packages/nextcloud/lib/src/webdav/client.dart @@ -3,15 +3,50 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:dynamite_runtime/http_client.dart'; +import 'package:http/http.dart' as http; import 'package:meta/meta.dart'; import 'package:nextcloud/src/webdav/path_uri.dart'; import 'package:nextcloud/src/webdav/props.dart'; import 'package:nextcloud/src/webdav/webdav.dart'; -import 'package:universal_io/io.dart'; +import 'package:universal_io/io.dart' hide HttpClient; /// Base path used on the server final webdavBase = PathUri.parse('/remote.php/webdav'); +@internal +class WebDavRequest extends http.BaseRequest { + WebDavRequest( + super.method, + super.url, { + this.dataStream, + this.data, + Map? headers, + }) : assert(dataStream == null || data == null, 'Only one of dataStream or data can be specified.') { + this.headers.addAll({ + ...?headers, + HttpHeaders.contentTypeHeader: 'application/xml', + }); + } + + final Stream>? dataStream; + final Uint8List? data; + + @override + http.ByteStream finalize() { + super.finalize(); + + if (dataStream != null) { + return http.ByteStream(dataStream!); + } + + if (data != null) { + return http.ByteStream.fromBytes(data!); + } + + return http.ByteStream.fromBytes(Uint8List(0)); + } +} + /// WebDavClient class class WebDavClient { // ignore: public_member_api_docs @@ -20,39 +55,34 @@ class WebDavClient { // ignore: public_member_api_docs final DynamiteClient rootClient; - Future _send( + Future _send( String method, Uri url, { - Stream? dataStream, + Stream>? dataStream, Uint8List? data, Map? headers, }) async { - assert(dataStream == null || data == null, 'Only one of dataStream or data can be specified.'); - - final request = await rootClient.httpClient.openUrl(method, url) - ..persistentConnection = true; + final request = WebDavRequest( + method, + url, + data: data, + dataStream: dataStream, + headers: headers, + ); request.headers.addAll({ - HttpHeaders.contentTypeHeader: 'application/xml', + if (rootClient.userAgent != null) HttpHeaders.userAgentHeader: rootClient.userAgent!, ...?rootClient.baseHeaders, - ...?headers, ...?rootClient.authentications.firstOrNull?.headers, }); - if (data != null) { - request.add(data); - } - if (dataStream != null) { - await request.addStream(dataStream); - } - - final response = await request.close(); + final response = await rootClient.httpClient.send(request); - if (response.statusCode > 299) { + if (response.statusCode >= 300) { throw DynamiteApiException( response.statusCode, - response.responseHeaders, - await response.string, + response.headers, + await response.stream.string, ); } @@ -71,8 +101,8 @@ class WebDavClient { return baseURL.replace(pathSegments: segments.where((s) => s.isNotEmpty)); } - Future _parseResponse(HttpClientResponse response) async => - WebDavMultistatus.fromXmlElement(await response.xml); + Future _parseResponse(http.StreamedResponse response) async => + WebDavMultistatus.fromXmlElement(await response.stream.xml); Map _getUploadHeaders({ required DateTime? lastModified, @@ -92,8 +122,8 @@ class WebDavClient { _constructUri(), ); - final davCapabilities = response.headers['dav']?.first; - final davSearchCapabilities = response.headers['dasl']?.first; + final davCapabilities = response.headers['dav']; + final davSearchCapabilities = response.headers['dasl']; return WebDavOptions( davCapabilities?.split(',').map((e) => e.trim()).where((e) => e.isNotEmpty).toSet(), davSearchCapabilities?.split(',').map((e) => e.trim()).where((e) => e.isNotEmpty).toSet(), @@ -103,7 +133,7 @@ class WebDavClient { /// Creates a collection at [path]. /// /// See http://www.webdav.org/specs/rfc2518.html#METHOD_MKCOL for more information. - Future mkcol(PathUri path) async => _send( + Future mkcol(PathUri path) async => _send( 'MKCOL', _constructUri(path), ); @@ -111,7 +141,7 @@ class WebDavClient { /// Deletes the resource at [path]. /// /// See http://www.webdav.org/specs/rfc2518.html#METHOD_DELETE for more information. - Future delete(PathUri path) => _send( + Future delete(PathUri path) => _send( 'DELETE', _constructUri(path), ); @@ -121,7 +151,7 @@ class WebDavClient { /// [lastModified] sets the date when the file was last modified on the server. /// [created] sets the date when the file was created on the server. /// See http://www.webdav.org/specs/rfc2518.html#METHOD_PUT for more information. - Future put( + Future put( Uint8List localData, PathUri path, { DateTime? lastModified, @@ -145,8 +175,8 @@ class WebDavClient { /// [contentLength] sets the length of the [localData] that is uploaded. /// [onProgress] can be used to watch the upload progress. Possible values range from 0.0 to 1.0. [contentLength] needs to be set for it to work. /// See http://www.webdav.org/specs/rfc2518.html#METHOD_PUT for more information. - Future putStream( - Stream localData, + Future putStream( + Stream> localData, PathUri path, { DateTime? lastModified, DateTime? created, @@ -157,10 +187,10 @@ class WebDavClient { return _send( 'PUT', _constructUri(path), - dataStream: contentLength != null + dataStream: contentLength != null && onProgress != null ? localData.map((chunk) { uploaded += chunk.length; - onProgress?.call(uploaded / contentLength); + onProgress.call(uploaded / contentLength); return chunk; }) : localData, @@ -178,7 +208,7 @@ class WebDavClient { /// [created] sets the date when the file was created on the server. /// [onProgress] can be used to watch the upload progress. Possible values range from 0.0 to 1.0. /// See http://www.webdav.org/specs/rfc2518.html#METHOD_PUT for more information. - Future putFile( + Future putFile( File file, FileStat fileStat, PathUri path, { @@ -187,7 +217,7 @@ class WebDavClient { void Function(double progress)? onProgress, }) async => putStream( - file.openRead().cast(), + file.openRead(), path, lastModified: lastModified, created: created, @@ -196,10 +226,10 @@ class WebDavClient { ); /// Gets the content of the file at [path]. - Future get(PathUri path) async => (await getStream(path)).bytes; + Future get(PathUri path) async => (await getStream(path)).stream.bytes; /// Gets the content of the file at [path]. - Future getStream(PathUri path) async => _send( + Future getStream(PathUri path) async => _send( 'GET', _constructUri(path), ); @@ -210,24 +240,24 @@ class WebDavClient { File file, { void Function(double progress)? onProgress, }) async { - final sink = file.openWrite(); final response = await getStream(path); - if (response.contentLength > 0) { + final contentLength = response.contentLength; + if (contentLength != null && contentLength > 0) { + final sink = file.openWrite(); final completer = Completer(); var downloaded = 0; - response.listen((chunk) async { + response.stream.listen((chunk) async { sink.add(chunk); downloaded += chunk.length; - onProgress?.call(downloaded / response.contentLength); - if (downloaded >= response.contentLength) { + onProgress?.call(downloaded / contentLength); + if (downloaded >= contentLength) { completer.complete(); } }); await completer.future; + await sink.close(); } - - await sink.close(); } /// Retrieves the props for the resource at [path]. @@ -309,7 +339,7 @@ class WebDavClient { /// /// If [overwrite] is set any existing resource will be replaced. /// See http://www.webdav.org/specs/rfc2518.html#METHOD_MOVE for more information. - Future move( + Future move( PathUri sourcePath, PathUri destinationPath, { bool overwrite = false, @@ -327,7 +357,7 @@ class WebDavClient { /// /// If [overwrite] is set any existing resource will be replaced. /// See http://www.webdav.org/specs/rfc2518.html#METHOD_COPY for more information. - Future copy( + Future copy( PathUri sourcePath, PathUri destinationPath, { bool overwrite = false, diff --git a/packages/nextcloud/lib/webdav.dart b/packages/nextcloud/lib/webdav.dart index c604cc3eb99..7980c9be706 100644 --- a/packages/nextcloud/lib/webdav.dart +++ b/packages/nextcloud/lib/webdav.dart @@ -2,7 +2,7 @@ import 'package:nextcloud/src/client.dart'; import 'package:nextcloud/src/webdav/client.dart'; -export 'src/webdav/client.dart'; +export 'src/webdav/client.dart' hide WebDavRequest; export 'src/webdav/file.dart'; export 'src/webdav/path_uri.dart'; export 'src/webdav/props.dart'; diff --git a/packages/nextcloud/pubspec.yaml b/packages/nextcloud/pubspec.yaml index ad12715cec0..8e4a9878d99 100644 --- a/packages/nextcloud/pubspec.yaml +++ b/packages/nextcloud/pubspec.yaml @@ -18,7 +18,8 @@ dependencies: crypto: ^3.0.0 crypton: ^2.0.0 dynamite_runtime: ^0.1.0 - intl: ">=0.17.0 <=0.19.0" + http: ^1.2.0 + intl: '>=0.17.0 <=0.19.0' json_annotation: ^4.8.1 meta: ^1.0.0 universal_io: ^2.0.0 diff --git a/packages/nextcloud/test/fixtures/core/app_password/delete.regexp b/packages/nextcloud/test/fixtures/core/app_password/delete.regexp index 14d03c3679a..b1fe566d0cd 100644 --- a/packages/nextcloud/test/fixtures/core/app_password/delete.regexp +++ b/packages/nextcloud/test/fixtures/core/app_password/delete.regexp @@ -1,14 +1,8 @@ DELETE http://localhost/ocs/v2\.php/core/apppassword -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/core/apppassword -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/autocomplete/get.regexp b/packages/nextcloud/test/fixtures/core/autocomplete/get.regexp index 1c8e7e6d2fd..247118cfaf4 100644 --- a/packages/nextcloud/test/fixtures/core/autocomplete/get.regexp +++ b/packages/nextcloud/test/fixtures/core/autocomplete/get.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/core/autocomplete/get\?search=&itemType=call&itemId=new&shareTypes%5B%5D=1&limit=10 -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/avatar/get.regexp b/packages/nextcloud/test/fixtures/core/avatar/get.regexp index 51080335618..b6d103e1b53 100644 --- a/packages/nextcloud/test/fixtures/core/avatar/get.regexp +++ b/packages/nextcloud/test/fixtures/core/avatar/get.regexp @@ -1,6 +1,3 @@ GET http://localhost/index\.php/avatar/admin/32 -accept-encoding: gzip accept: \*/\* -authorization: Bearer mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Bearer mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/avatar/get_dark.regexp b/packages/nextcloud/test/fixtures/core/avatar/get_dark.regexp index 1a1fdfe15fc..168745bf31b 100644 --- a/packages/nextcloud/test/fixtures/core/avatar/get_dark.regexp +++ b/packages/nextcloud/test/fixtures/core/avatar/get_dark.regexp @@ -1,6 +1,3 @@ GET http://localhost/index\.php/avatar/admin/32/dark -accept-encoding: gzip accept: \*/\* -authorization: Bearer mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Bearer mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/client_login_flow_v2/init_and_poll.regexp b/packages/nextcloud/test/fixtures/core/client_login_flow_v2/init_and_poll.regexp index 9d83421e2e3..35012541396 100644 --- a/packages/nextcloud/test/fixtures/core/client_login_flow_v2/init_and_poll.regexp +++ b/packages/nextcloud/test/fixtures/core/client_login_flow_v2/init_and_poll.regexp @@ -1,12 +1,6 @@ POST http://localhost/index\.php/login/v2 -accept-encoding: gzip accept: application/json authorization: Bearer mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/login/v2/poll\?token=[a-zA-Z0-9]{128} -accept-encoding: gzip accept: application/json -authorization: Bearer mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Bearer mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/get_status.regexp b/packages/nextcloud/test/fixtures/core/get_status.regexp index e96e38e8cc7..482fb19aad2 100644 --- a/packages/nextcloud/test/fixtures/core/get_status.regexp +++ b/packages/nextcloud/test/fixtures/core/get_status.regexp @@ -1,5 +1,2 @@ GET http://localhost/status\.php -accept-encoding: gzip -accept: application/json -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +accept: application/json \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/is_supported_from_capabilities.regexp b/packages/nextcloud/test/fixtures/core/is_supported_from_capabilities.regexp index d3d480cc6ac..ecfb7429a01 100644 --- a/packages/nextcloud/test/fixtures/core/is_supported_from_capabilities.regexp +++ b/packages/nextcloud/test/fixtures/core/is_supported_from_capabilities.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/cloud/capabilities -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/is_supported_from_status.regexp b/packages/nextcloud/test/fixtures/core/is_supported_from_status.regexp index e96e38e8cc7..482fb19aad2 100644 --- a/packages/nextcloud/test/fixtures/core/is_supported_from_status.regexp +++ b/packages/nextcloud/test/fixtures/core/is_supported_from_status.regexp @@ -1,5 +1,2 @@ GET http://localhost/status\.php -accept-encoding: gzip -accept: application/json -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +accept: application/json \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/navigation/get_apps_navigation.regexp b/packages/nextcloud/test/fixtures/core/navigation/get_apps_navigation.regexp index c20dd256ff4..bc7704b161a 100644 --- a/packages/nextcloud/test/fixtures/core/navigation/get_apps_navigation.regexp +++ b/packages/nextcloud/test/fixtures/core/navigation/get_apps_navigation.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/core/navigation/apps\?absolute=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/ocs/get_capabilities.regexp b/packages/nextcloud/test/fixtures/core/ocs/get_capabilities.regexp index d3d480cc6ac..ecfb7429a01 100644 --- a/packages/nextcloud/test/fixtures/core/ocs/get_capabilities.regexp +++ b/packages/nextcloud/test/fixtures/core/ocs/get_capabilities.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/cloud/capabilities -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/preview/get.regexp b/packages/nextcloud/test/fixtures/core/preview/get.regexp index 4ba285c1ec4..648b3acb471 100644 --- a/packages/nextcloud/test/fixtures/core/preview/get.regexp +++ b/packages/nextcloud/test/fixtures/core/preview/get.regexp @@ -1,6 +1,3 @@ GET http://localhost/index\.php/core/preview\.png\?file=Nextcloud\.png&x=32&y=32&a=0&forceIcon=1&mode=fill&mimeFallback=0 -accept-encoding: gzip accept: \*/\* -authorization: Bearer mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Bearer mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/unified_search/get_providers.regexp b/packages/nextcloud/test/fixtures/core/unified_search/get_providers.regexp index d93165f9895..77c1f6c52cc 100644 --- a/packages/nextcloud/test/fixtures/core/unified_search/get_providers.regexp +++ b/packages/nextcloud/test/fixtures/core/unified_search/get_providers.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/search/providers\?from= -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/core/unified_search/search.regexp b/packages/nextcloud/test/fixtures/core/unified_search/search.regexp index 64b8b27e9c5..89573dac820 100644 --- a/packages/nextcloud/test/fixtures/core/unified_search/search.regexp +++ b/packages/nextcloud/test/fixtures/core/unified_search/search.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/search/providers/settings/search\?term=Personal%20info&from= -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/dashboard/get_widget_items/v1.regexp b/packages/nextcloud/test/fixtures/dashboard/get_widget_items/v1.regexp index a0703448d87..0274ad6056a 100644 --- a/packages/nextcloud/test/fixtures/dashboard/get_widget_items/v1.regexp +++ b/packages/nextcloud/test/fixtures/dashboard/get_widget_items/v1.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/apps/dashboard/api/v1/widget-items\?limit=7 -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/dashboard/get_widget_items/v2.regexp b/packages/nextcloud/test/fixtures/dashboard/get_widget_items/v2.regexp index 98f3f0b9ef3..3e934fb47f1 100644 --- a/packages/nextcloud/test/fixtures/dashboard/get_widget_items/v2.regexp +++ b/packages/nextcloud/test/fixtures/dashboard/get_widget_items/v2.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/apps/dashboard/api/v2/widget-items\?limit=7 -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/dashboard/get_widgets.regexp b/packages/nextcloud/test/fixtures/dashboard/get_widgets.regexp index 8383a58c404..77622e4ebf4 100644 --- a/packages/nextcloud/test/fixtures/dashboard/get_widgets.regexp +++ b/packages/nextcloud/test/fixtures/dashboard/get_widgets.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/apps/dashboard/api/v1/widgets -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/add_feed.regexp b/packages/nextcloud/test/fixtures/news/add_feed.regexp index eb31067b270..0cec60895d4 100644 --- a/packages/nextcloud/test/fixtures/news/add_feed.regexp +++ b/packages/nextcloud/test/fixtures/news/add_feed.regexp @@ -1,18 +1,9 @@ GET http://localhost/index\.php/apps/news/api/v1-3/feeds -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/feeds -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/add_feed_to_folder.regexp b/packages/nextcloud/test/fixtures/news/add_feed_to_folder.regexp index 8739a2aa7e2..6722ad2dc2a 100644 --- a/packages/nextcloud/test/fixtures/news/add_feed_to_folder.regexp +++ b/packages/nextcloud/test/fixtures/news/add_feed_to_folder.regexp @@ -1,12 +1,6 @@ POST http://localhost/index\.php/apps/news/api/v1-3/folders\?name=test1 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml&folderId=1 -accept-encoding: gzip accept: application/json -authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/create_folder.regexp b/packages/nextcloud/test/fixtures/news/create_folder.regexp index 143224dd8c7..b8b7a72a714 100644 --- a/packages/nextcloud/test/fixtures/news/create_folder.regexp +++ b/packages/nextcloud/test/fixtures/news/create_folder.regexp @@ -1,18 +1,9 @@ GET http://localhost/index\.php/apps/news/api/v1-3/folders -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/folders\?name=test1 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/folders -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/delete_feed.regexp b/packages/nextcloud/test/fixtures/news/delete_feed.regexp index 9544adc560a..cea219af90d 100644 --- a/packages/nextcloud/test/fixtures/news/delete_feed.regexp +++ b/packages/nextcloud/test/fixtures/news/delete_feed.regexp @@ -1,17 +1,8 @@ POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/index\.php/apps/news/api/v1-3/feeds/1 -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/feeds -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/delete_folder.regexp b/packages/nextcloud/test/fixtures/news/delete_folder.regexp index fb283d1ad13..7bcf1c3a10c 100644 --- a/packages/nextcloud/test/fixtures/news/delete_folder.regexp +++ b/packages/nextcloud/test/fixtures/news/delete_folder.regexp @@ -1,17 +1,8 @@ POST http://localhost/index\.php/apps/news/api/v1-3/folders\?name=test1 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/index\.php/apps/news/api/v1-3/folders/1 -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/folders -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/is_supported.regexp b/packages/nextcloud/test/fixtures/news/is_supported.regexp index 16db7a210c6..f57ae4c7a0c 100644 --- a/packages/nextcloud/test/fixtures/news/is_supported.regexp +++ b/packages/nextcloud/test/fixtures/news/is_supported.regexp @@ -1,6 +1,3 @@ GET http://localhost/index\.php/apps/news/api -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/list_articles.regexp b/packages/nextcloud/test/fixtures/news/list_articles.regexp index 80c614bbca8..ff990b31a97 100644 --- a/packages/nextcloud/test/fixtures/news/list_articles.regexp +++ b/packages/nextcloud/test/fixtures/news/list_articles.regexp @@ -1,18 +1,9 @@ GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=3&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=3&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/list_folders.regexp b/packages/nextcloud/test/fixtures/news/list_folders.regexp index 1221b6170ad..cea059bbd7b 100644 --- a/packages/nextcloud/test/fixtures/news/list_folders.regexp +++ b/packages/nextcloud/test/fixtures/news/list_folders.regexp @@ -1,24 +1,12 @@ GET http://localhost/index\.php/apps/news/api/v1-3/folders -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/folders\?name=test1 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/folders\?name=test2 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/folders -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/list_updated_articles.regexp b/packages/nextcloud/test/fixtures/news/list_updated_articles.regexp index 075a6151f29..1216d0fab46 100644 --- a/packages/nextcloud/test/fixtures/news/list_updated_articles.regexp +++ b/packages/nextcloud/test/fixtures/news/list_updated_articles.regexp @@ -1,30 +1,15 @@ POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=3&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fnasa\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=3&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items/updated\?type=3&id=0&lastModified=[0-9]+ -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/mark_article_as_read.regexp b/packages/nextcloud/test/fixtures/news/mark_article_as_read.regexp index 94dfce1229e..717087d1d19 100644 --- a/packages/nextcloud/test/fixtures/news/mark_article_as_read.regexp +++ b/packages/nextcloud/test/fixtures/news/mark_article_as_read.regexp @@ -1,23 +1,11 @@ POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=6&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/items/10/read -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=6&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/mark_article_as_unread.regexp b/packages/nextcloud/test/fixtures/news/mark_article_as_unread.regexp index 61dab298ecc..3cdf3c60cd7 100644 --- a/packages/nextcloud/test/fixtures/news/mark_article_as_unread.regexp +++ b/packages/nextcloud/test/fixtures/news/mark_article_as_unread.regexp @@ -1,34 +1,16 @@ POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=6&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/items/10/read -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=6&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/items/10/unread -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=6&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/mark_feed_as_read.regexp b/packages/nextcloud/test/fixtures/news/mark_feed_as_read.regexp index 6d6d4017729..5d50de543e0 100644 --- a/packages/nextcloud/test/fixtures/news/mark_feed_as_read.regexp +++ b/packages/nextcloud/test/fixtures/news/mark_feed_as_read.regexp @@ -1,23 +1,11 @@ POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=6&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/feeds/1/read\?newestItemId=10 -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=6&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/mark_folder_as_read.regexp b/packages/nextcloud/test/fixtures/news/mark_folder_as_read.regexp index 75285619474..f5716ad0d3d 100644 --- a/packages/nextcloud/test/fixtures/news/mark_folder_as_read.regexp +++ b/packages/nextcloud/test/fixtures/news/mark_folder_as_read.regexp @@ -1,29 +1,14 @@ POST http://localhost/index\.php/apps/news/api/v1-3/folders\?name=test1 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml&folderId=1 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=6&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/folders/1/read\?newestItemId=10 -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=6&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/move_feed_to_folder.regexp b/packages/nextcloud/test/fixtures/news/move_feed_to_folder.regexp index 9dbecd17a20..6d08534387e 100644 --- a/packages/nextcloud/test/fixtures/news/move_feed_to_folder.regexp +++ b/packages/nextcloud/test/fixtures/news/move_feed_to_folder.regexp @@ -1,23 +1,11 @@ POST http://localhost/index\.php/apps/news/api/v1-3/folders\?name=test1 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/feeds/1/move\?folderId=1 -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/folders -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/rename_feed.regexp b/packages/nextcloud/test/fixtures/news/rename_feed.regexp index 8e130bdb574..05edf7fb291 100644 --- a/packages/nextcloud/test/fixtures/news/rename_feed.regexp +++ b/packages/nextcloud/test/fixtures/news/rename_feed.regexp @@ -1,17 +1,8 @@ POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/feeds/1/rename\?feedTitle=test1 -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/feeds -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/rename_folder.regexp b/packages/nextcloud/test/fixtures/news/rename_folder.regexp index 56dcd4aa406..41dac14e7e3 100644 --- a/packages/nextcloud/test/fixtures/news/rename_folder.regexp +++ b/packages/nextcloud/test/fixtures/news/rename_folder.regexp @@ -1,17 +1,8 @@ POST http://localhost/index\.php/apps/news/api/v1-3/folders\?name=test1 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/index\.php/apps/news/api/v1-3/folders/1\?name=test2 -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/folders -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/star_article.regexp b/packages/nextcloud/test/fixtures/news/star_article.regexp index cbada852d18..02efd022cd5 100644 --- a/packages/nextcloud/test/fixtures/news/star_article.regexp +++ b/packages/nextcloud/test/fixtures/news/star_article.regexp @@ -1,29 +1,14 @@ POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=2&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=3&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/items/10/star -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=2&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/news/unstar_article.regexp b/packages/nextcloud/test/fixtures/news/unstar_article.regexp index 74bccaf8988..639c4f371fb 100644 --- a/packages/nextcloud/test/fixtures/news/unstar_article.regexp +++ b/packages/nextcloud/test/fixtures/news/unstar_article.regexp @@ -1,34 +1,16 @@ POST http://localhost/index\.php/apps/news/api/v1-3/feeds\?url=http%3A%2F%2Flocalhost%2Fstatic%2Fwikipedia\.xml -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=3&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/items/10/star -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=2&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/news/api/v1-3/items/10/unstar -accept-encoding: gzip authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/news/api/v1-3/items\?type=2&id=0&getRead=1&batchSize=-1&offset=0&oldestFirst=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notes/create_note_favorite.regexp b/packages/nextcloud/test/fixtures/notes/create_note_favorite.regexp index e31ea1e04b1..9a775982ce5 100644 --- a/packages/nextcloud/test/fixtures/notes/create_note_favorite.regexp +++ b/packages/nextcloud/test/fixtures/notes/create_note_favorite.regexp @@ -1,18 +1,9 @@ GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\)( +authorization: Basic mock( DELETE http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+ -accept-encoding: gzip accept: application/json -authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\))* +authorization: Basic mock)* POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=c&title=a&content=b&modified=0&favorite=1 -accept-encoding: gzip accept: application/json -authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notes/create_note_not_favorite.regexp b/packages/nextcloud/test/fixtures/notes/create_note_not_favorite.regexp index 9f24f6b29a2..d447d973764 100644 --- a/packages/nextcloud/test/fixtures/notes/create_note_not_favorite.regexp +++ b/packages/nextcloud/test/fixtures/notes/create_note_not_favorite.regexp @@ -1,18 +1,9 @@ GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+ -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=c&title=a&content=b&modified=0&favorite=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notes/delete_note.regexp b/packages/nextcloud/test/fixtures/notes/delete_note.regexp index 50ad7f7c2ee..56f3ae41d0a 100644 --- a/packages/nextcloud/test/fixtures/notes/delete_note.regexp +++ b/packages/nextcloud/test/fixtures/notes/delete_note.regexp @@ -1,36 +1,18 @@ GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+ -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+ -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notes/get_and_update_settings.regexp b/packages/nextcloud/test/fixtures/notes/get_and_update_settings.regexp index 7b7263a786b..dc55265f9fd 100644 --- a/packages/nextcloud/test/fixtures/notes/get_and_update_settings.regexp +++ b/packages/nextcloud/test/fixtures/notes/get_and_update_settings.regexp @@ -1,20 +1,11 @@ GET http://localhost/index\.php/apps/notes/api/v1/settings -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/index\.php/apps/notes/api/v1/settings -accept-encoding: gzip accept: application/json authorization: Basic mock content-type: application/json -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \{"notesPath":"Test Notes","fileSuffix":"\.txt","noteMode":"preview"\} GET http://localhost/index\.php/apps/notes/api/v1/settings -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notes/get_note.regexp b/packages/nextcloud/test/fixtures/notes/get_note.regexp index 590090c62ae..bf9d51a296c 100644 --- a/packages/nextcloud/test/fixtures/notes/get_note.regexp +++ b/packages/nextcloud/test/fixtures/notes/get_note.regexp @@ -1,24 +1,12 @@ GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\)( +authorization: Basic mock( DELETE http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+ -accept-encoding: gzip accept: application/json -authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\))* +authorization: Basic mock)* POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+\?exclude= -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notes/get_notes.regexp b/packages/nextcloud/test/fixtures/notes/get_notes.regexp index 1d9425bc817..5b9a489b7ea 100644 --- a/packages/nextcloud/test/fixtures/notes/get_notes.regexp +++ b/packages/nextcloud/test/fixtures/notes/get_notes.regexp @@ -1,30 +1,15 @@ GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+ -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=b&content=&modified=0&favorite=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notes/is_supported.regexp b/packages/nextcloud/test/fixtures/notes/is_supported.regexp index d3d480cc6ac..ecfb7429a01 100644 --- a/packages/nextcloud/test/fixtures/notes/is_supported.regexp +++ b/packages/nextcloud/test/fixtures/notes/is_supported.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/cloud/capabilities -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notes/update_note.regexp b/packages/nextcloud/test/fixtures/notes/update_note.regexp index 7bce2a87298..83362ed9a39 100644 --- a/packages/nextcloud/test/fixtures/notes/update_note.regexp +++ b/packages/nextcloud/test/fixtures/notes/update_note.regexp @@ -1,30 +1,15 @@ GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+ -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+\?title=b -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+\?exclude= -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notes/update_note_fail_changed_on_server.regexp b/packages/nextcloud/test/fixtures/notes/update_note_fail_changed_on_server.regexp index c45dcd6cbd7..0b798b25356 100644 --- a/packages/nextcloud/test/fixtures/notes/update_note_fail_changed_on_server.regexp +++ b/packages/nextcloud/test/fixtures/notes/update_note_fail_changed_on_server.regexp @@ -1,32 +1,17 @@ GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+ -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+\?title=b -accept-encoding: gzip accept: application/json authorization: Basic mock if-match: "[a-z0-9]{32}" -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+\?title=c -accept-encoding: gzip accept: application/json authorization: Basic mock -if-match: "[a-z0-9]{32}" -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +if-match: "[a-z0-9]{32}" \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notifications/api/send_admin_notification.regexp b/packages/nextcloud/test/fixtures/notifications/api/send_admin_notification.regexp index d0056e88a92..ba10af7e4cf 100644 --- a/packages/nextcloud/test/fixtures/notifications/api/send_admin_notification.regexp +++ b/packages/nextcloud/test/fixtures/notifications/api/send_admin_notification.regexp @@ -1,7 +1,4 @@ POST http://localhost/ocs/v2\.php/apps/notifications/api/v2/admin_notifications/admin\?shortMessage=123&longMessage=456 -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notifications/endpoint/delete_all_notifications.regexp b/packages/nextcloud/test/fixtures/notifications/endpoint/delete_all_notifications.regexp index 0a3067bf6fd..dbdcc5c3656 100644 --- a/packages/nextcloud/test/fixtures/notifications/endpoint/delete_all_notifications.regexp +++ b/packages/nextcloud/test/fixtures/notifications/endpoint/delete_all_notifications.regexp @@ -1,35 +1,20 @@ DELETE http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/notifications/api/v2/admin_notifications/admin\?shortMessage=123&longMessage=456 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/notifications/api/v2/admin_notifications/admin\?shortMessage=123&longMessage=456 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notifications/endpoint/delete_notification.regexp b/packages/nextcloud/test/fixtures/notifications/endpoint/delete_notification.regexp index ab6fe9af7b6..ca7f3fe1e7d 100644 --- a/packages/nextcloud/test/fixtures/notifications/endpoint/delete_notification.regexp +++ b/packages/nextcloud/test/fixtures/notifications/endpoint/delete_notification.regexp @@ -1,35 +1,20 @@ DELETE http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/notifications/api/v2/admin_notifications/admin\?shortMessage=123&longMessage=456 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications/5 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notifications/endpoint/get_notification.regexp b/packages/nextcloud/test/fixtures/notifications/endpoint/get_notification.regexp index 83b8dafab9f..9f37bc8b7e8 100644 --- a/packages/nextcloud/test/fixtures/notifications/endpoint/get_notification.regexp +++ b/packages/nextcloud/test/fixtures/notifications/endpoint/get_notification.regexp @@ -1,28 +1,16 @@ DELETE http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/notifications/api/v2/admin_notifications/admin\?shortMessage=123&longMessage=456 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications/[0-9]+ -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notifications/endpoint/list_notifications.regexp b/packages/nextcloud/test/fixtures/notifications/endpoint/list_notifications.regexp index 9141857d35c..500e27c3bd6 100644 --- a/packages/nextcloud/test/fixtures/notifications/endpoint/list_notifications.regexp +++ b/packages/nextcloud/test/fixtures/notifications/endpoint/list_notifications.regexp @@ -1,21 +1,12 @@ DELETE http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/notifications/api/v2/admin_notifications/admin\?shortMessage=123&longMessage=456 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/notifications/api/v2/notifications -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/notifications/push/register_and_remove_push_device.regexp b/packages/nextcloud/test/fixtures/notifications/push/register_and_remove_push_device.regexp index 6f85483d6b3..c83630c250e 100644 --- a/packages/nextcloud/test/fixtures/notifications/push/register_and_remove_push_device.regexp +++ b/packages/nextcloud/test/fixtures/notifications/push/register_and_remove_push_device.regexp @@ -1,14 +1,8 @@ POST http://localhost/ocs/v2\.php/apps/notifications/api/v2/push\?pushTokenHash=[a-z0-9]{128}&devicePublicKey=-----BEGIN%20PUBLIC%20KEY-----[a-zA-Z0-9%]+-----END%20PUBLIC%20KEY-----&proxyServer=https%3A%2F%2Fexample\.com%2F -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/notifications/api/v2/push -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/provisioning_api/apps/get.regexp b/packages/nextcloud/test/fixtures/provisioning_api/apps/get.regexp index f73c962a7a7..3078aa2da01 100644 --- a/packages/nextcloud/test/fixtures/provisioning_api/apps/get.regexp +++ b/packages/nextcloud/test/fixtures/provisioning_api/apps/get.regexp @@ -1,14 +1,8 @@ GET http://localhost/ocs/v2\.php/cloud/apps -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) (GET http://localhost/ocs/v2\.php/cloud/apps/[a-z_]+ -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\)\n?)+ \ No newline at end of file +ocs-apirequest: true\n?)+ \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/provisioning_api/users/get_current_user.regexp b/packages/nextcloud/test/fixtures/provisioning_api/users/get_current_user.regexp index f6438d09465..a3148a73da0 100644 --- a/packages/nextcloud/test/fixtures/provisioning_api/users/get_current_user.regexp +++ b/packages/nextcloud/test/fixtures/provisioning_api/users/get_current_user.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/cloud/user -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/provisioning_api/users/get_user_by_username.regexp b/packages/nextcloud/test/fixtures/provisioning_api/users/get_user_by_username.regexp index 9d65d266bb4..2124d8864b9 100644 --- a/packages/nextcloud/test/fixtures/provisioning_api/users/get_user_by_username.regexp +++ b/packages/nextcloud/test/fixtures/provisioning_api/users/get_user_by_username.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/cloud/users/user1 -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/settings/logs/download.regexp b/packages/nextcloud/test/fixtures/settings/logs/download.regexp index 0d9ab546010..d3f13097257 100644 --- a/packages/nextcloud/test/fixtures/settings/logs/download.regexp +++ b/packages/nextcloud/test/fixtures/settings/logs/download.regexp @@ -1,6 +1,3 @@ GET http://localhost/index\.php/settings/admin/log/download -accept-encoding: gzip accept: application/octet-stream -authorization: Bearer mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Bearer mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/call/start_and_end_call.regexp b/packages/nextcloud/test/fixtures/spreed/call/start_and_end_call.regexp index d7a99891303..e0b931b5768 100644 --- a/packages/nextcloud/test/fixtures/spreed/call/start_and_end_call.regexp +++ b/packages/nextcloud/test/fixtures/spreed/call/start_and_end_call.regexp @@ -1,42 +1,24 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password=&force=1 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/call/[a-z0-9]{8}\?silent=0&recordingConsent=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8} -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/spreed/api/v4/call/[a-z0-9]{8}\?all=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8} -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/chat/get_messages/directly.regexp b/packages/nextcloud/test/fixtures/spreed/chat/get_messages/directly.regexp index de0e257e099..ad6e9032120 100644 --- a/packages/nextcloud/test/fixtures/spreed/chat/get_messages/directly.regexp +++ b/packages/nextcloud/test/fixtures/spreed/chat/get_messages/directly.regexp @@ -1,28 +1,16 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=bla&actorDisplayName=&referenceId=&replyTo=0&silent=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=123&actorDisplayName=&referenceId=&replyTo=[0-9]+&silent=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?lookIntoFuture=0&limit=100&lastKnownMessageId=0&lastCommonReadId=0&timeout=30&setReadMarker=1&includeLastKnown=0&noStatusUpdate=0&markNotificationsAsRead=1 -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/chat/get_messages/polling.regexp b/packages/nextcloud/test/fixtures/spreed/chat/get_messages/polling.regexp index c63ab6fe4e8..ef811dc44df 100644 --- a/packages/nextcloud/test/fixtures/spreed/chat/get_messages/polling.regexp +++ b/packages/nextcloud/test/fixtures/spreed/chat/get_messages/polling.regexp @@ -1,28 +1,16 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=bla&actorDisplayName=&referenceId=&replyTo=0&silent=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?lookIntoFuture=1&limit=100&lastKnownMessageId=[0-9]+&lastCommonReadId=0&timeout=3&setReadMarker=1&includeLastKnown=0&noStatusUpdate=0&markNotificationsAsRead=1 -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=123&actorDisplayName=&referenceId=&replyTo=0&silent=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/chat/send_message.regexp b/packages/nextcloud/test/fixtures/spreed/chat/send_message.regexp index c7422389519..fc0c56b0bf6 100644 --- a/packages/nextcloud/test/fixtures/spreed/chat/send_message.regexp +++ b/packages/nextcloud/test/fixtures/spreed/chat/send_message.regexp @@ -1,14 +1,8 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=bla&actorDisplayName=&referenceId=&replyTo=0&silent=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/helpers/is_supported.regexp b/packages/nextcloud/test/fixtures/spreed/helpers/is_supported.regexp index d3d480cc6ac..ecfb7429a01 100644 --- a/packages/nextcloud/test/fixtures/spreed/helpers/is_supported.regexp +++ b/packages/nextcloud/test/fixtures/spreed/helpers/is_supported.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/cloud/capabilities -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/room/create_room/group.regexp b/packages/nextcloud/test/fixtures/spreed/room/create_room/group.regexp index 9a6463355b4..7f4c0ee8346 100644 --- a/packages/nextcloud/test/fixtures/spreed/room/create_room/group.regexp +++ b/packages/nextcloud/test/fixtures/spreed/room/create_room/group.regexp @@ -1,7 +1,4 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=2&invite=admin&roomName=&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/room/create_room/one-to-one.regexp b/packages/nextcloud/test/fixtures/spreed/room/create_room/one-to-one.regexp index 1366c91c893..0134c709a7c 100644 --- a/packages/nextcloud/test/fixtures/spreed/room/create_room/one-to-one.regexp +++ b/packages/nextcloud/test/fixtures/spreed/room/create_room/one-to-one.regexp @@ -1,7 +1,4 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=1&invite=user2&roomName=&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/room/create_room/public.regexp b/packages/nextcloud/test/fixtures/spreed/room/create_room/public.regexp index 97663072853..157e3e2c811 100644 --- a/packages/nextcloud/test/fixtures/spreed/room/create_room/public.regexp +++ b/packages/nextcloud/test/fixtures/spreed/room/create_room/public.regexp @@ -1,7 +1,4 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=abc&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/room/get_rooms.regexp b/packages/nextcloud/test/fixtures/spreed/room/get_rooms.regexp index 0c2e807a226..807b9c326b0 100644 --- a/packages/nextcloud/test/fixtures/spreed/room/get_rooms.regexp +++ b/packages/nextcloud/test/fixtures/spreed/room/get_rooms.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?noStatusUpdate=0&includeStatus=0&modifiedSince=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/room/session.regexp b/packages/nextcloud/test/fixtures/spreed/room/session.regexp index e146c9edf37..f2b2ae528ab 100644 --- a/packages/nextcloud/test/fixtures/spreed/room/session.regexp +++ b/packages/nextcloud/test/fixtures/spreed/room/session.regexp @@ -1,35 +1,20 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password=&force=1 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8} -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8} -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/signaling/get_settings.regexp b/packages/nextcloud/test/fixtures/spreed/signaling/get_settings.regexp index 9a880e0a114..19bf0e42ba3 100644 --- a/packages/nextcloud/test/fixtures/spreed/signaling/get_settings.regexp +++ b/packages/nextcloud/test/fixtures/spreed/signaling/get_settings.regexp @@ -1,14 +1,8 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/spreed/api/v3/signaling/settings\?token=[a-z0-9]{8} -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/spreed/signaling/send_and_receive_messages.regexp b/packages/nextcloud/test/fixtures/spreed/signaling/send_and_receive_messages.regexp index b47c92287bf..40e0b052cf0 100644 --- a/packages/nextcloud/test/fixtures/spreed/signaling/send_and_receive_messages.regexp +++ b/packages/nextcloud/test/fixtures/spreed/signaling/send_and_receive_messages.regexp @@ -1,49 +1,28 @@ POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password=&force=1 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/call/[a-z0-9]{8}\?silent=0&recordingConsent=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password=&force=1 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/call/[a-z0-9]{8}\?silent=0&recordingConsent=0 -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) POST http://localhost/ocs/v2\.php/apps/spreed/api/v3/signaling/[a-z0-9]{8}\?messages=[a-zA-Z0-9%]+ -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/spreed/api/v3/signaling/[a-z0-9]{8} -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/uppush/create_app.regexp b/packages/nextcloud/test/fixtures/uppush/create_app.regexp index bf89449dc5b..7a37c0af553 100644 --- a/packages/nextcloud/test/fixtures/uppush/create_app.regexp +++ b/packages/nextcloud/test/fixtures/uppush/create_app.regexp @@ -1,12 +1,6 @@ PUT http://localhost/index\.php/apps/uppush/device\?deviceName=Test -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/index\.php/apps/uppush/app\?deviceId=[a-zA-Z0-9-_]+&appName=Test -accept-encoding: gzip accept: application/json -authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/uppush/create_device.regexp b/packages/nextcloud/test/fixtures/uppush/create_device.regexp index d67b46e7de3..b3d4b119f81 100644 --- a/packages/nextcloud/test/fixtures/uppush/create_device.regexp +++ b/packages/nextcloud/test/fixtures/uppush/create_device.regexp @@ -1,6 +1,3 @@ PUT http://localhost/index\.php/apps/uppush/device\?deviceName=Test -accept-encoding: gzip accept: application/json -authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/uppush/delete_device.regexp b/packages/nextcloud/test/fixtures/uppush/delete_device.regexp index 6eba31d1aa3..213c638add9 100644 --- a/packages/nextcloud/test/fixtures/uppush/delete_device.regexp +++ b/packages/nextcloud/test/fixtures/uppush/delete_device.regexp @@ -1,12 +1,6 @@ PUT http://localhost/index\.php/apps/uppush/device\?deviceName=Test -accept-encoding: gzip accept: application/json authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/index\.php/apps/uppush/device/[a-zA-Z0-9-_]+ -accept-encoding: gzip accept: application/json -authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/uppush/is_installed.regexp b/packages/nextcloud/test/fixtures/uppush/is_installed.regexp index 073187b3349..286818f5d88 100644 --- a/packages/nextcloud/test/fixtures/uppush/is_installed.regexp +++ b/packages/nextcloud/test/fixtures/uppush/is_installed.regexp @@ -1,6 +1,3 @@ GET http://localhost/index\.php/apps/uppush -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/uppush/matrix_gateway_discovery.regexp b/packages/nextcloud/test/fixtures/uppush/matrix_gateway_discovery.regexp index b42c0e65df6..6f0341fec8f 100644 --- a/packages/nextcloud/test/fixtures/uppush/matrix_gateway_discovery.regexp +++ b/packages/nextcloud/test/fixtures/uppush/matrix_gateway_discovery.regexp @@ -1,6 +1,3 @@ GET http://localhost/index\.php/apps/uppush/gateway/matrix -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/uppush/set_keepalive.regexp b/packages/nextcloud/test/fixtures/uppush/set_keepalive.regexp index 339d80b4128..b621d6a2c6e 100644 --- a/packages/nextcloud/test/fixtures/uppush/set_keepalive.regexp +++ b/packages/nextcloud/test/fixtures/uppush/set_keepalive.regexp @@ -1,6 +1,3 @@ PUT http://localhost/index\.php/apps/uppush/keepalive\?keepalive=10 -accept-encoding: gzip accept: application/json -authorization: Basic mock -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/uppush/unifiedpush_discovery.regexp b/packages/nextcloud/test/fixtures/uppush/unifiedpush_discovery.regexp index f2487114385..3054ff80519 100644 --- a/packages/nextcloud/test/fixtures/uppush/unifiedpush_discovery.regexp +++ b/packages/nextcloud/test/fixtures/uppush/unifiedpush_discovery.regexp @@ -1,6 +1,3 @@ GET http://localhost/index\.php/apps/uppush/push/example -accept-encoding: gzip accept: application/json -authorization: Basic mock -content-length: 0 -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +authorization: Basic mock \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/user_status/heartbeat/heartbeat.regexp b/packages/nextcloud/test/fixtures/user_status/heartbeat/heartbeat.regexp index dbc26034d2f..454a77136dd 100644 --- a/packages/nextcloud/test/fixtures/user_status/heartbeat/heartbeat.regexp +++ b/packages/nextcloud/test/fixtures/user_status/heartbeat/heartbeat.regexp @@ -1,21 +1,12 @@ PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/status\?statusType=online -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/heartbeat\?status=online -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/user_status/predefined_status/find_all.regexp b/packages/nextcloud/test/fixtures/user_status/predefined_status/find_all.regexp index f0a69f40a31..897fb91842c 100644 --- a/packages/nextcloud/test/fixtures/user_status/predefined_status/find_all.regexp +++ b/packages/nextcloud/test/fixtures/user_status/predefined_status/find_all.regexp @@ -1,7 +1,4 @@ GET http://localhost/ocs/v2\.php/apps/user_status/api/v1/predefined_statuses -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/user_status/statuses/find_all.regexp b/packages/nextcloud/test/fixtures/user_status/statuses/find_all.regexp index df2029648ce..8005df83b6a 100644 --- a/packages/nextcloud/test/fixtures/user_status/statuses/find_all.regexp +++ b/packages/nextcloud/test/fixtures/user_status/statuses/find_all.regexp @@ -1,21 +1,12 @@ PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/status\?statusType=online -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/user_status/api/v1/statuses -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/user_status/user_status/clear_message.regexp b/packages/nextcloud/test/fixtures/user_status/user_status/clear_message.regexp index 30fff00f100..f61e1afa7b1 100644 --- a/packages/nextcloud/test/fixtures/user_status/user_status/clear_message.regexp +++ b/packages/nextcloud/test/fixtures/user_status/user_status/clear_message.regexp @@ -1,35 +1,20 @@ PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/status\?statusType=online -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message/custom\?statusIcon=%F0%9F%98%80&message=bla&clearAt=[0-9]+ -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/user_status/user_status/find.regexp b/packages/nextcloud/test/fixtures/user_status/user_status/find.regexp index cf7fe6b1f26..b727c1ad698 100644 --- a/packages/nextcloud/test/fixtures/user_status/user_status/find.regexp +++ b/packages/nextcloud/test/fixtures/user_status/user_status/find.regexp @@ -1,21 +1,12 @@ PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/status\?statusType=online -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/user_status/api/v1/statuses/user1 -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/user_status/user_status/get.regexp b/packages/nextcloud/test/fixtures/user_status/user_status/get.regexp index b4f9d846d67..a79c91f08c6 100644 --- a/packages/nextcloud/test/fixtures/user_status/user_status/get.regexp +++ b/packages/nextcloud/test/fixtures/user_status/user_status/get.regexp @@ -1,21 +1,12 @@ PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/status\?statusType=online -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) GET http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status -accept-encoding: gzip accept: application/json authorization: Bearer mock -content-length: 0 -ocs-apirequest: true -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/user_status/user_status/set.regexp b/packages/nextcloud/test/fixtures/user_status/user_status/set.regexp index 610853a99b5..ead1d6822b0 100644 --- a/packages/nextcloud/test/fixtures/user_status/user_status/set.regexp +++ b/packages/nextcloud/test/fixtures/user_status/user_status/set.regexp @@ -1,21 +1,12 @@ PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/status\?statusType=online -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/status\?statusType=online -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/user_status/user_status/set_custom_message.regexp b/packages/nextcloud/test/fixtures/user_status/user_status/set_custom_message.regexp index ab793e49491..cdb5f5d2feb 100644 --- a/packages/nextcloud/test/fixtures/user_status/user_status/set_custom_message.regexp +++ b/packages/nextcloud/test/fixtures/user_status/user_status/set_custom_message.regexp @@ -1,21 +1,12 @@ PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/status\?statusType=online -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message/custom\?statusIcon=%F0%9F%98%80&message=bla&clearAt=[0-9]+ -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/user_status/user_status/set_predefined_message.regexp b/packages/nextcloud/test/fixtures/user_status/user_status/set_predefined_message.regexp index 1f9af7c714c..178458bc59b 100644 --- a/packages/nextcloud/test/fixtures/user_status/user_status/set_predefined_message.regexp +++ b/packages/nextcloud/test/fixtures/user_status/user_status/set_predefined_message.regexp @@ -1,21 +1,12 @@ PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/status\?statusType=online -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message -accept-encoding: gzip accept: application/json authorization: Bearer mock ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/ocs/v2\.php/apps/user_status/api/v1/user_status/message/predefined\?messageId=meeting&clearAt=[0-9]+ -accept-encoding: gzip accept: application/json authorization: Bearer mock -ocs-apirequest: true -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/filter_files.regexp b/packages/nextcloud/test/fixtures/webdav/filter_files.regexp index 88e7b0c3aae..5464bb2cc82 100644 --- a/packages/nextcloud/test/fixtures/webdav/filter_files.regexp +++ b/packages/nextcloud/test/fixtures/webdav/filter_files.regexp @@ -1,21 +1,13 @@ PUT http://localhost/remote\.php/webdav/filter\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 4 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) test PROPPATCH http://localhost/remote\.php/webdav/filter\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) 1 REPORT http://localhost/remote\.php/webdav -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) 1 \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/get_directory_props.regexp b/packages/nextcloud/test/fixtures/webdav/get_directory_props.regexp index 4e3840fe493..e3bcf9de3cc 100644 --- a/packages/nextcloud/test/fixtures/webdav/get_directory_props.regexp +++ b/packages/nextcloud/test/fixtures/webdav/get_directory_props.regexp @@ -1,21 +1,13 @@ MKCOL http://localhost/remote\.php/webdav/dir-props -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/dir-props/test\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 4 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) test PROPFIND http://localhost/remote\.php/webdav/dir-props -accept-encoding: gzip authorization: Bearer mock content-type: application/xml depth: 0 -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/get_file_props.regexp b/packages/nextcloud/test/fixtures/webdav/get_file_props.regexp index e331b7e21d3..0c7de8dc4e0 100644 --- a/packages/nextcloud/test/fixtures/webdav/get_file_props.regexp +++ b/packages/nextcloud/test/fixtures/webdav/get_file_props.regexp @@ -1,7 +1,4 @@ PROPFIND http://localhost/remote\.php/webdav/Nextcloud\.png -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/list_directory.regexp b/packages/nextcloud/test/fixtures/webdav/list_directory.regexp index 0a0822d8eb7..e7a6e5f75a9 100644 --- a/packages/nextcloud/test/fixtures/webdav/list_directory.regexp +++ b/packages/nextcloud/test/fixtures/webdav/list_directory.regexp @@ -1,7 +1,4 @@ PROPFIND http://localhost/remote\.php/webdav -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/list_directory_recursively.regexp b/packages/nextcloud/test/fixtures/webdav/list_directory_recursively.regexp index 4e85dae6d66..095b9cafa28 100644 --- a/packages/nextcloud/test/fixtures/webdav/list_directory_recursively.regexp +++ b/packages/nextcloud/test/fixtures/webdav/list_directory_recursively.regexp @@ -1,8 +1,5 @@ PROPFIND http://localhost/remote\.php/webdav -accept-encoding: gzip authorization: Bearer mock content-type: application/xml depth: infinity -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete.regexp index 8dfd1e3aa47..92bb9c757fa 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete.regexp @@ -1,12 +1,7 @@ PUT http://localhost/remote\.php/webdav/delete\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/delete\.txt -accept-encoding: gzip authorization: Bearer mock -content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete_coll.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete_coll.regexp index c014e561441..b782c7cde6c 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete_coll.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete_coll.regexp @@ -1,12 +1,6 @@ MKCOL http://localhost/remote\.php/webdav/delete-coll -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/delete-coll -accept-encoding: gzip authorization: Bearer mock -content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete_null.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete_null.regexp index 32c51d8f8a2..60325ce0ce7 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete_null.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/delete_null.regexp @@ -1,6 +1,3 @@ DELETE http://localhost/remote\.php/webdav/delete-null\.txt -accept-encoding: gzip authorization: Bearer mock -content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol.regexp index 023df312f01..27ff07b10ee 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol.regexp @@ -1,6 +1,3 @@ MKCOL http://localhost/remote\.php/webdav/mkcol -accept-encoding: gzip authorization: Bearer mock -content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol_again.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol_again.regexp index cea65b6823d..2750a8a51a8 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol_again.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol_again.regexp @@ -1,12 +1,6 @@ MKCOL http://localhost/remote\.php/webdav/mkcol-again -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MKCOL http://localhost/remote\.php/webdav/mkcol-again -accept-encoding: gzip authorization: Bearer mock -content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol_no_parent.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol_no_parent.regexp index fef3b3bb9a3..e29621594dc 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol_no_parent.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/mkcol_no_parent.regexp @@ -1,6 +1,3 @@ MKCOL http://localhost/remote\.php/webdav/409me/noparent -accept-encoding: gzip authorization: Bearer mock -content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/options.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/options.regexp index 711d59bf384..eed382ffef0 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/options.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/options.regexp @@ -1,6 +1,3 @@ OPTIONS http://localhost/remote\.php/webdav -accept-encoding: gzip authorization: Bearer mock -content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_get.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_get.regexp index 5082b3a2082..6b52e158c44 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_get.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_get.regexp @@ -1,13 +1,8 @@ PUT http://localhost/remote\.php/webdav/res -accept-encoding: gzip authorization: Bearer mock content-length: 19 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) This is a test file GET http://localhost/remote\.php/webdav/res -accept-encoding: gzip authorization: Bearer mock -content-length: 0 -content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_get_utf8_segment.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_get_utf8_segment.regexp index 9ec816a43fb..bc918386ad0 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_get_utf8_segment.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_get_utf8_segment.regexp @@ -1,13 +1,8 @@ PUT http://localhost/remote\.php/webdav/res-%25e2%2582%25ac -accept-encoding: gzip authorization: Bearer mock content-length: 19 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) This is a test file GET http://localhost/remote\.php/webdav/res-%25e2%2582%25ac -accept-encoding: gzip authorization: Bearer mock -content-length: 0 -content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_no_parent.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_no_parent.regexp index 0d2e909fcfb..84296bf460b 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_no_parent.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/basic/put_no_parent.regexp @@ -1,6 +1,4 @@ PUT http://localhost/remote\.php/webdav/409me/noparent\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 -content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_coll.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_coll.regexp index b4398877b93..891f384ead9 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_coll.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_coll.regexp @@ -1,176 +1,102 @@ MKCOL http://localhost/remote\.php/webdav/copy-coll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MKCOL http://localhost/remote\.php/webdav/copy-coll-src/sub -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/0\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/1\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/2\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/3\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/4\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/5\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/6\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/7\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/8\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/copy-coll-src/9\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/copy-coll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/copy-coll-dst1 overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/copy-coll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/copy-coll-dst2 overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/copy-coll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/copy-coll-dst1 overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/copy-coll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/copy-coll-dst2 overwrite: T -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/0\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/1\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/2\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/3\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/4\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/5\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/6\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/7\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/8\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/9\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst1/sub -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/copy-coll-dst2 -accept-encoding: gzip authorization: Bearer mock -content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_nodestcoll.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_nodestcoll.regexp index 0f2e323db86..2d0a911b9bc 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_nodestcoll.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_nodestcoll.regexp @@ -1,14 +1,8 @@ MKCOL http://localhost/remote\.php/webdav/copy-nodestcoll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/copy-nodestcoll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/nonesuch/dst -overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +overwrite: F \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_overwrite.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_overwrite.regexp index 34966fe6290..2b5e425e2f5 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_overwrite.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_overwrite.regexp @@ -1,28 +1,16 @@ MKCOL http://localhost/remote\.php/webdav/copy-overwrite-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MKCOL http://localhost/remote\.php/webdav/copy-overwrite-dst -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/copy-overwrite-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/copy-overwrite-dst overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/copy-overwrite-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/copy-overwrite-dst -overwrite: T -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +overwrite: T \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_simple.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_simple.regexp index 5a1421a8658..c337032e552 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_simple.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/copy_simple.regexp @@ -1,14 +1,8 @@ MKCOL http://localhost/remote\.php/webdav/copy-simple-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/copy-simple-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/copy-simple-dst -overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +overwrite: F \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/move.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/move.regexp index 7b07fde3a12..0094c0d023d 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/move.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/move.regexp @@ -1,42 +1,26 @@ PUT http://localhost/remote\.php/webdav/move-src1\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-src2\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) MKCOL http://localhost/remote\.php/webdav/move-coll -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MOVE http://localhost/remote\.php/webdav/move-src1\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/move-dst\.txt overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MOVE http://localhost/remote\.php/webdav/move-src2\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/move-dst\.txt overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MOVE http://localhost/remote\.php/webdav/move-src2\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/move-dst\.txt -overwrite: T -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +overwrite: T \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/move_coll.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/move_coll.regexp index 1ef708f17b5..b401b1bfce6 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/copymove/move_coll.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/copymove/move_coll.regexp @@ -1,192 +1,113 @@ MKCOL http://localhost/remote\.php/webdav/move-coll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MKCOL http://localhost/remote\.php/webdav/move-coll-src/sub -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/0\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/1\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/2\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/3\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/4\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/5\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/6\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/7\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/8\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-src/9\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) PUT http://localhost/remote\.php/webdav/move-coll-noncoll -accept-encoding: gzip authorization: Bearer mock content-length: 0 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/move-coll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/move-coll-dst2 overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MOVE http://localhost/remote\.php/webdav/move-coll-src -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/move-coll-dst1 overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MOVE http://localhost/remote\.php/webdav/move-coll-dst1 -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/move-coll-dst2 overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MOVE http://localhost/remote\.php/webdav/move-coll-dst2 -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/move-coll-dst1 overwrite: T -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) COPY http://localhost/remote\.php/webdav/move-coll-dst1 -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/move-coll-dst2 overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/0\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/1\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/2\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/3\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/4\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/5\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/6\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/7\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/8\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/9\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) DELETE http://localhost/remote\.php/webdav/move-coll-dst1/sub -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) MOVE http://localhost/remote\.php/webdav/move-coll-dst2 -accept-encoding: gzip authorization: Bearer mock content-type: application/xml destination: http://localhost/remote\.php/webdav/move-coll-noncoll -overwrite: F -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +overwrite: F \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/litmus/largefile/large_get.regexp b/packages/nextcloud/test/fixtures/webdav/litmus/largefile/large_get.regexp index 160c6ca8746..9fab30cb05a 100644 --- a/packages/nextcloud/test/fixtures/webdav/litmus/largefile/large_get.regexp +++ b/packages/nextcloud/test/fixtures/webdav/litmus/largefile/large_get.regexp @@ -1,13 +1,8 @@ PUT http://localhost/remote\.php/webdav/largefile\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 1000000000 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) .* GET http://localhost/remote\.php/webdav/largefile\.txt -accept-encoding: gzip authorization: Bearer mock -content-length: 0 -content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/remove_properties.regexp b/packages/nextcloud/test/fixtures/webdav/remove_properties.regexp index 4c5d136c424..43be699a7a2 100644 --- a/packages/nextcloud/test/fixtures/webdav/remove_properties.regexp +++ b/packages/nextcloud/test/fixtures/webdav/remove_properties.regexp @@ -1,35 +1,21 @@ PUT http://localhost/remote\.php/webdav/remove-props\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 4 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) test PROPPATCH http://localhost/remote\.php/webdav/remove-props\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) 1 PROPFIND http://localhost/remote\.php/webdav/remove-props\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PROPPATCH http://localhost/remote\.php/webdav/remove-props\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) PROPFIND http://localhost/remote\.php/webdav/remove-props\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/set_properties.regexp b/packages/nextcloud/test/fixtures/webdav/set_properties.regexp index 3ab35dd8429..fd6466f2e13 100644 --- a/packages/nextcloud/test/fixtures/webdav/set_properties.regexp +++ b/packages/nextcloud/test/fixtures/webdav/set_properties.regexp @@ -1,23 +1,15 @@ PUT http://localhost/remote\.php/webdav/set-props\.txt -accept-encoding: gzip authorization: Bearer mock content-length: 4 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) x-oc-ctime: 34214400 x-oc-mtime: 68256000 test PROPPATCH http://localhost/remote\.php/webdav/set-props\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) 1 PROPFIND http://localhost/remote\.php/webdav/set-props\.txt -accept-encoding: gzip authorization: Bearer mock content-type: application/xml -transfer-encoding: chunked -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/webdav/upload_and_download_file.regexp b/packages/nextcloud/test/fixtures/webdav/upload_and_download_file.regexp index aa6a991021c..f8dcee35667 100644 --- a/packages/nextcloud/test/fixtures/webdav/upload_and_download_file.regexp +++ b/packages/nextcloud/test/fixtures/webdav/upload_and_download_file.regexp @@ -1,13 +1,8 @@ PUT http://localhost/remote\.php/webdav/upload\.png -accept-encoding: gzip authorization: Bearer mock content-length: 8650 content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) iVBORw0KGgoAAAANSUhEUgAAB4AAAAQ4CAIAAABnsVYUAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5AMPEAwo2\+TdNAAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAACAASURBVHja7NgxAQAgDMAwQMH8O8IVJuiXSOjZfWcWAAAAAAD8diQAAAAAAKBgQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQBDQAAAABAwoAGAAAAACBhQAMAAAAAkDCgAQAAAABIGNAAAAAAACQMaAAAAAAAEgY0AAAAAAAJAxoAAAAAgIQB/dqxYwEAAACAQf7Wo9hXGAEAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADZL2FUgAAAThJREFUAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwEJAAwAAAACwENAAAAAAACwENAAAAAAACwENAAAAAMBCQAMAAAAAsBDQAAAAAAAsBDQAAAAAAAsBDQAAAADAQkADAAAAALAQ0AAAAAAALAQ0AAAAAAALAQ0AAAAAwCKNfglZ0nZIRwAAAABJRU5ErkJggg== GET http://localhost/remote\.php/webdav/upload\.png -accept-encoding: gzip authorization: Bearer mock -content-length: 0 -content-type: application/xml -user-agent: Dart/3\.2 \(dart:io\) \ No newline at end of file +content-type: application/xml \ No newline at end of file diff --git a/packages/nextcloud/test/webdav_test.dart b/packages/nextcloud/test/webdav_test.dart index 5074378e53d..afa70a04e26 100644 --- a/packages/nextcloud/test/webdav_test.dart +++ b/packages/nextcloud/test/webdav_test.dart @@ -305,7 +305,7 @@ void main() { test('Filter files', () async { final response = await client.webdav.put(utf8.encode('test'), PathUri.parse('filter.txt')); - final id = response.headers['oc-fileid']!.first; + final id = response.headers['oc-fileid']; await client.webdav.proppatch( PathUri.parse('filter.txt'), set: WebDavProp( diff --git a/packages/nextcloud_test/lib/src/proxy_http_client.dart b/packages/nextcloud_test/lib/src/proxy_http_client.dart index 091e8244544..756af8787f9 100644 --- a/packages/nextcloud_test/lib/src/proxy_http_client.dart +++ b/packages/nextcloud_test/lib/src/proxy_http_client.dart @@ -1,117 +1,54 @@ // ignore_for_file: invalid_use_of_visible_for_testing_member -import 'dart:async'; import 'dart:convert'; import 'dart:typed_data'; -import 'package:dynamite_runtime/http_client.dart'; -import 'package:mocktail/mocktail.dart'; +import 'package:http/http.dart'; +import 'package:http/testing.dart'; import 'package:universal_io/io.dart'; -// ignore: public_member_api_docs -class MockHttpClient extends Mock implements HttpClient {} - -// ignore: public_member_api_docs -class MockHttpRequest extends Mock implements HttpClientRequest {} - -// ignore: public_member_api_docs -class MockHttpResponse extends Mock implements HttpClientResponse {} - -// ignore: public_member_api_docs -class ByteStreamFake extends Fake implements Stream> {} - /// Gets a mocked [HttpClient] that proxies the request to a real [HttpClient]. /// For every requests it calls [onRequest] which contains the formatted request. -HttpClient getProxyHttpClient({ - required void Function(String data) onRequest, +BaseClient getProxyHttpClient({ + required void Function(String fixture) onRequest, }) { - registerFallbackValue(Uri()); - registerFallbackValue(ByteStreamFake()); - - final mockClient = MockHttpClient(); - final realClient = HttpClient(); - - // ignore: discarded_futures - when(() => mockClient.openUrl(any(), any())).thenAnswer((invocation) async { - final mockRequest = MockHttpRequest(); - final realRequest = await realClient.openUrl( - invocation.positionalArguments[0]! as String, - invocation.positionalArguments[1]! as Uri, - ); - - final bodyBytes = BytesBuilder(); - - when(() => mockRequest.headers).thenReturn(realRequest.headers); - when(() => mockRequest.cookies).thenReturn(realRequest.cookies); - when(() => mockRequest.add(any())).thenAnswer((invocation) { - final chunk = invocation.positionalArguments[0] as List; - bodyBytes.add(chunk); - return realRequest.add(chunk); - }); - when(() => mockRequest.addStream(any())).thenAnswer((invocation) { - final stream = invocation.positionalArguments[0] as Stream>; - return realRequest.addStream( - stream.map((chunk) { - bodyBytes.add(chunk); - return chunk; - }), - ); - }); - when(mockRequest.close).thenAnswer((invocation) async { - onRequest(_formatHttpRequest(realRequest, bodyBytes.toBytes())); - - final mockResponse = MockHttpResponse(); - final realResponse = await realRequest.close(); - - when(() => mockResponse.headers).thenReturn(realResponse.headers); - when(() => mockResponse.cookies).thenReturn(realResponse.cookies); - when(() => mockResponse.contentLength).thenReturn(realResponse.contentLength); - when(() => mockResponse.statusCode).thenReturn(realResponse.statusCode); - when(() => mockResponse.forEach(any())).thenAnswer( - (invocation) async => realResponse.forEach(invocation.positionalArguments[0]! as void Function(List)), - ); - when(() => mockResponse.listen(any())).thenAnswer( - (invocation) => realResponse.listen(invocation.positionalArguments[0]! as void Function(List)), - ); - when(() => mockResponse.transform(utf8.decoder)).thenAnswer( - (_) => realResponse.transform(utf8.decoder), - ); - when(() => mockResponse.transform(jsonBytesConverter)).thenAnswer( - (_) => realResponse.transform(jsonBytesConverter), - ); - when(() => mockResponse.transform(xmlBytesConverter)).thenAnswer( - (_) => realResponse.transform(xmlBytesConverter), - ); - - return mockResponse; - }); - - return mockRequest; + final realClient = Client(); + return MockClient.streaming((baseRequest, bytesStream) async { + final bodyBytes = await bytesStream.toBytes(); + final fixture = _formatHttpRequest(baseRequest, bodyBytes); + onRequest(fixture); + + final request = Request(baseRequest.method, baseRequest.url) + ..persistentConnection = baseRequest.persistentConnection + ..followRedirects = baseRequest.followRedirects + ..maxRedirects = baseRequest.maxRedirects + ..headers.addAll(baseRequest.headers) + ..bodyBytes = bodyBytes; + + return realClient.send(request); }); - - return mockClient; } -String _formatHttpRequest(HttpClientRequest request, Uint8List body) { - final buffer = StringBuffer('${request.method} ${request.uri.replace(port: 80)}'); +String _formatHttpRequest(BaseRequest request, Uint8List body) { + final buffer = StringBuffer('${request.method.toUpperCase()} ${request.url.replace(port: 80)}'); final headers = []; - request.headers.forEach((name, values) { + for (final header in request.headers.entries) { + final name = header.key.toLowerCase(); + var value = header.value; + if (name == HttpHeaders.hostHeader) { - return; + continue; + } else if (name == HttpHeaders.cookieHeader) { + continue; + } else if (name == HttpHeaders.authorizationHeader) { + value = '${value.split(' ').first} mock'; + } else if (name == 'destination') { + value = Uri.parse(value).replace(port: 80).toString(); } - for (var value in values) { - if (name == HttpHeaders.authorizationHeader) { - value = '${value.split(' ').first} mock'; - } - if (name == 'destination') { - value = Uri.parse(value).replace(port: 80).toString(); - } - - headers.add('\n$name: $value'); - } - }); + headers.add('\n$name: $value'); + } headers.sort(); buffer.writeAll(headers); diff --git a/packages/nextcloud_test/pubspec.yaml b/packages/nextcloud_test/pubspec.yaml index 59d76c2acb5..414e4566366 100644 --- a/packages/nextcloud_test/pubspec.yaml +++ b/packages/nextcloud_test/pubspec.yaml @@ -8,8 +8,8 @@ environment: dependencies: built_collection: ^5.0.0 dynamite_runtime: ^0.1.0 + http: ^1.2.0 meta: ^1.0.0 - mocktail: ^1.0.0 nextcloud: ^4.0.0 process_run: ^0.14.0+1 test: ^1.24.0 From 9d7d86a80b1f124ec5e6452ec59b5635f1e9a037 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Thu, 18 Jan 2024 07:18:45 +0100 Subject: [PATCH 2/2] feat(dynamite,nextcloud)!: drop userAgent parameter The useragent should be passed with the baseHeaders instead Signed-off-by: Nikolas Rimikis --- .../dynamite/dynamite/example/lib/petstore.openapi.dart | 1 - packages/dynamite/dynamite/lib/src/builder/client.dart | 6 ------ .../lib/authentication.openapi.dart | 1 - .../lib/documentation.openapi.dart | 1 - .../dynamite_end_to_end_test/lib/headers.openapi.dart | 1 - .../dynamite_end_to_end_test/lib/parameters.openapi.dart | 1 - .../lib/request_body.openapi.dart | 1 - .../dynamite_end_to_end_test/lib/responses.openapi.dart | 1 - .../dynamite_end_to_end_test/lib/tags.openapi.dart | 1 - .../dynamite_runtime/lib/src/dynamite_client.dart | 5 ----- packages/nextcloud/lib/src/api/core.openapi.dart | 1 - packages/nextcloud/lib/src/api/dashboard.openapi.dart | 1 - packages/nextcloud/lib/src/api/dav.openapi.dart | 1 - packages/nextcloud/lib/src/api/files.openapi.dart | 1 - .../nextcloud/lib/src/api/files_external.openapi.dart | 1 - .../nextcloud/lib/src/api/files_reminders.openapi.dart | 1 - packages/nextcloud/lib/src/api/files_sharing.openapi.dart | 1 - .../nextcloud/lib/src/api/files_trashbin.openapi.dart | 1 - .../nextcloud/lib/src/api/files_versions.openapi.dart | 1 - packages/nextcloud/lib/src/api/news.openapi.dart | 1 - packages/nextcloud/lib/src/api/notes.openapi.dart | 1 - packages/nextcloud/lib/src/api/notifications.openapi.dart | 1 - .../nextcloud/lib/src/api/provisioning_api.openapi.dart | 1 - packages/nextcloud/lib/src/api/settings.openapi.dart | 1 - packages/nextcloud/lib/src/api/spreed.openapi.dart | 1 - packages/nextcloud/lib/src/api/theming.openapi.dart | 1 - .../nextcloud/lib/src/api/updatenotification.openapi.dart | 1 - packages/nextcloud/lib/src/api/uppush.openapi.dart | 1 - packages/nextcloud/lib/src/api/user_status.openapi.dart | 1 - .../nextcloud/lib/src/api/weather_status.openapi.dart | 1 - packages/nextcloud/lib/src/client.dart | 8 ++++++-- packages/nextcloud/lib/src/webdav/client.dart | 1 - 32 files changed, 6 insertions(+), 42 deletions(-) diff --git a/packages/dynamite/dynamite/example/lib/petstore.openapi.dart b/packages/dynamite/dynamite/example/lib/petstore.openapi.dart index 2170ef5e9dd..9538a536877 100644 --- a/packages/dynamite/dynamite/example/lib/petstore.openapi.dart +++ b/packages/dynamite/dynamite/example/lib/petstore.openapi.dart @@ -39,7 +39,6 @@ class $Client extends _i2.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, }); diff --git a/packages/dynamite/dynamite/lib/src/builder/client.dart b/packages/dynamite/dynamite/lib/src/builder/client.dart index 5cb609d7d38..45d3481b1f8 100644 --- a/packages/dynamite/dynamite/lib/src/builder/client.dart +++ b/packages/dynamite/dynamite/lib/src/builder/client.dart @@ -63,12 +63,6 @@ Class buildRootClient( ..toSuper = true ..named = true, ), - Parameter( - (b) => b - ..name = 'userAgent' - ..toSuper = true - ..named = true, - ), Parameter( (b) => b ..name = 'httpClient' diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/authentication.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/authentication.openapi.dart index 706e92f3f66..34afe8e73aa 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/authentication.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/authentication.openapi.dart @@ -21,7 +21,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/documentation.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/documentation.openapi.dart index 0fb2bf373f5..c6cb77ba066 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/documentation.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/documentation.openapi.dart @@ -39,7 +39,6 @@ class $Client extends _i2.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, }); diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart index fd4ac360cbc..9a04bcee2c1 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart @@ -24,7 +24,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, }); diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart index 85598c78ada..7400fc3f5b0 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart @@ -29,7 +29,6 @@ class $Client extends _i3.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, }); diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/request_body.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/request_body.openapi.dart index 01895cbe220..c7ddc0bb7c6 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/request_body.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/request_body.openapi.dart @@ -22,7 +22,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, }); diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/responses.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/responses.openapi.dart index db8ce8acb0f..d4e678936b1 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/responses.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/responses.openapi.dart @@ -19,7 +19,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, }); diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/tags.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/tags.openapi.dart index 11f88379697..3776624d762 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/tags.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/tags.openapi.dart @@ -19,7 +19,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, }); diff --git a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart index 8894f6b85a9..e9a436e04dd 100644 --- a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart +++ b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart @@ -377,7 +377,6 @@ class DynamiteClient { DynamiteClient( Uri baseURL, { this.baseHeaders, - this.userAgent, http.Client? httpClient, this.cookieJar, this.authentications = const [], @@ -397,9 +396,6 @@ class DynamiteClient { /// The base headers added to each request. final Map? baseHeaders; - /// The value sent in the `user-agent` header. - final String? userAgent; - /// The base http client. final http.Client httpClient; @@ -429,7 +425,6 @@ class DynamiteClient { method, uri, { - if (userAgent != null) 'user-agent': userAgent!, ...?baseHeaders, ...headers, }, diff --git a/packages/nextcloud/lib/src/api/core.openapi.dart b/packages/nextcloud/lib/src/api/core.openapi.dart index f79256f8bb8..304feefb494 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.dart +++ b/packages/nextcloud/lib/src/api/core.openapi.dart @@ -36,7 +36,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/dashboard.openapi.dart b/packages/nextcloud/lib/src/api/dashboard.openapi.dart index 422f9ffabcd..a364fc43012 100644 --- a/packages/nextcloud/lib/src/api/dashboard.openapi.dart +++ b/packages/nextcloud/lib/src/api/dashboard.openapi.dart @@ -33,7 +33,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/dav.openapi.dart b/packages/nextcloud/lib/src/api/dav.openapi.dart index 37373ef1f31..607841754fa 100644 --- a/packages/nextcloud/lib/src/api/dav.openapi.dart +++ b/packages/nextcloud/lib/src/api/dav.openapi.dart @@ -32,7 +32,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/files.openapi.dart b/packages/nextcloud/lib/src/api/files.openapi.dart index 04e3630832c..069c8f493e7 100644 --- a/packages/nextcloud/lib/src/api/files.openapi.dart +++ b/packages/nextcloud/lib/src/api/files.openapi.dart @@ -35,7 +35,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/files_external.openapi.dart b/packages/nextcloud/lib/src/api/files_external.openapi.dart index 602430496d6..76fabd7d9e4 100644 --- a/packages/nextcloud/lib/src/api/files_external.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_external.openapi.dart @@ -32,7 +32,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart index 679ec6568b6..08a5fa7203f 100644 --- a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart @@ -32,7 +32,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart index a7360c990ae..44f2107cfe3 100644 --- a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart @@ -35,7 +35,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart index 8d0c82555ae..4c51aedcb3d 100644 --- a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart @@ -33,7 +33,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/files_versions.openapi.dart b/packages/nextcloud/lib/src/api/files_versions.openapi.dart index 59e4133b8a2..552615e679d 100644 --- a/packages/nextcloud/lib/src/api/files_versions.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_versions.openapi.dart @@ -32,7 +32,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/news.openapi.dart b/packages/nextcloud/lib/src/api/news.openapi.dart index 69c4a56b1e1..f491733d294 100644 --- a/packages/nextcloud/lib/src/api/news.openapi.dart +++ b/packages/nextcloud/lib/src/api/news.openapi.dart @@ -33,7 +33,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/notes.openapi.dart b/packages/nextcloud/lib/src/api/notes.openapi.dart index 13118d9277e..f5fbdf0e6c3 100644 --- a/packages/nextcloud/lib/src/api/notes.openapi.dart +++ b/packages/nextcloud/lib/src/api/notes.openapi.dart @@ -37,7 +37,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/notifications.openapi.dart b/packages/nextcloud/lib/src/api/notifications.openapi.dart index 90cb1ff8f39..90a646d57b9 100644 --- a/packages/nextcloud/lib/src/api/notifications.openapi.dart +++ b/packages/nextcloud/lib/src/api/notifications.openapi.dart @@ -33,7 +33,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart index fa0bfd5aaef..f7d53f4c9c9 100644 --- a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart +++ b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart @@ -34,7 +34,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/settings.openapi.dart b/packages/nextcloud/lib/src/api/settings.openapi.dart index 8f25b42340a..2cf36532261 100644 --- a/packages/nextcloud/lib/src/api/settings.openapi.dart +++ b/packages/nextcloud/lib/src/api/settings.openapi.dart @@ -31,7 +31,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/spreed.openapi.dart b/packages/nextcloud/lib/src/api/spreed.openapi.dart index 502c7f28194..27012d31a53 100644 --- a/packages/nextcloud/lib/src/api/spreed.openapi.dart +++ b/packages/nextcloud/lib/src/api/spreed.openapi.dart @@ -36,7 +36,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/theming.openapi.dart b/packages/nextcloud/lib/src/api/theming.openapi.dart index 9ee9f559646..dd286e874e7 100644 --- a/packages/nextcloud/lib/src/api/theming.openapi.dart +++ b/packages/nextcloud/lib/src/api/theming.openapi.dart @@ -35,7 +35,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart index e08ae8a88f3..e3deb860ea4 100644 --- a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart +++ b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart @@ -32,7 +32,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/uppush.openapi.dart b/packages/nextcloud/lib/src/api/uppush.openapi.dart index 77990487238..07d704c4b2e 100644 --- a/packages/nextcloud/lib/src/api/uppush.openapi.dart +++ b/packages/nextcloud/lib/src/api/uppush.openapi.dart @@ -31,7 +31,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/user_status.openapi.dart b/packages/nextcloud/lib/src/api/user_status.openapi.dart index b93b9103d00..557d22c8d4f 100644 --- a/packages/nextcloud/lib/src/api/user_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/user_status.openapi.dart @@ -33,7 +33,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/api/weather_status.openapi.dart b/packages/nextcloud/lib/src/api/weather_status.openapi.dart index f992b6d8b21..5726f48def3 100644 --- a/packages/nextcloud/lib/src/api/weather_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/weather_status.openapi.dart @@ -32,7 +32,6 @@ class $Client extends _i1.DynamiteClient { $Client( super.baseURL, { super.baseHeaders, - super.userAgent, super.httpClient, super.cookieJar, super.authentications, diff --git a/packages/nextcloud/lib/src/client.dart b/packages/nextcloud/lib/src/client.dart index 1e760326652..c0af1976491 100644 --- a/packages/nextcloud/lib/src/client.dart +++ b/packages/nextcloud/lib/src/client.dart @@ -1,4 +1,5 @@ import 'package:dynamite_runtime/http_client.dart'; +import 'package:universal_io/io.dart'; /// Different app types to register for enum AppType { @@ -33,8 +34,11 @@ class NextcloudClient extends DynamiteClient { super.httpClient, super.cookieJar, }) : super( - baseHeaders: language != null ? {'Accept-Language': language} : null, - userAgent: userAgentOverride ?? appType.userAgent, + baseHeaders: { + if (language != null) HttpHeaders.acceptLanguageHeader: language, + if ((userAgentOverride ?? appType.userAgent) != null) + HttpHeaders.userAgentHeader: userAgentOverride ?? appType.userAgent!, + }, authentications: [ if (appPassword != null) DynamiteHttpBearerAuthentication( diff --git a/packages/nextcloud/lib/src/webdav/client.dart b/packages/nextcloud/lib/src/webdav/client.dart index 85c218301fe..b6bdc9fc3c5 100644 --- a/packages/nextcloud/lib/src/webdav/client.dart +++ b/packages/nextcloud/lib/src/webdav/client.dart @@ -71,7 +71,6 @@ class WebDavClient { ); request.headers.addAll({ - if (rootClient.userAgent != null) HttpHeaders.userAgentHeader: rootClient.userAgent!, ...?rootClient.baseHeaders, ...?rootClient.authentications.firstOrNull?.headers, });