From 215967fe89c55a9fc6d9296e8390a20a8ac2043f Mon Sep 17 00:00:00 2001 From: Johannes Endres Date: Wed, 1 Jan 2025 19:44:49 +0100 Subject: [PATCH] Change UserAgent to *cloud --- .../tests/Check/RequestUserAgentTest.php | 16 ++++++++-------- lib/public/IRequest.php | 2 +- tests/lib/AppFramework/Http/RequestTest.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/workflowengine/tests/Check/RequestUserAgentTest.php b/apps/workflowengine/tests/Check/RequestUserAgentTest.php index cc5cf3209b3bf..30e389c823631 100644 --- a/apps/workflowengine/tests/Check/RequestUserAgentTest.php +++ b/apps/workflowengine/tests/Check/RequestUserAgentTest.php @@ -42,45 +42,45 @@ public function dataExecuteCheck() { ['is', 'android', 'Mozilla/5.0 (iOS) Nextcloud-iOS/2.2.0', false], ['is', 'android', 'Mozilla/5.0 (Linux) mirall/2.2.0', false], ['is', 'android', 'Mozilla/5.0 (Windows) Nextcloud-Outlook v2.2.0', false], - ['is', 'android', 'Mozilla/5.0 (Linux) Nextcloud-Thunderbird v2.2.0', false], + ['is', 'android', 'Filelink for *cloud/2.2.0', false], ['!is', 'android', 'Mozilla/5.0 (Android) Nextcloud-android/2.2.0', false], ['!is', 'android', 'Mozilla/5.0 (iOS) Nextcloud-iOS/2.2.0', true], ['!is', 'android', 'Mozilla/5.0 (Linux) mirall/2.2.0', true], ['!is', 'android', 'Mozilla/5.0 (Windows) Nextcloud-Outlook v2.2.0', true], - ['!is', 'android', 'Mozilla/5.0 (Linux) Nextcloud-Thunderbird v2.2.0', true], + ['!is', 'android', 'Filelink for *cloud/2.2.0', true], ['is', 'ios', 'Mozilla/5.0 (Android) Nextcloud-android/2.2.0', false], ['is', 'ios', 'Mozilla/5.0 (iOS) Nextcloud-iOS/2.2.0', true], ['is', 'ios', 'Mozilla/5.0 (Linux) mirall/2.2.0', false], ['is', 'ios', 'Mozilla/5.0 (Windows) Nextcloud-Outlook v2.2.0', false], - ['is', 'ios', 'Mozilla/5.0 (Linux) Nextcloud-Thunderbird v2.2.0', false], + ['is', 'ios', 'Filelink for *cloud/2.2.0', false], ['!is', 'ios', 'Mozilla/5.0 (Android) Nextcloud-android/2.2.0', true], ['!is', 'ios', 'Mozilla/5.0 (iOS) Nextcloud-iOS/2.2.0', false], ['!is', 'ios', 'Mozilla/5.0 (Linux) mirall/2.2.0', true], ['!is', 'ios', 'Mozilla/5.0 (Windows) Nextcloud-Outlook v2.2.0', true], - ['!is', 'ios', 'Mozilla/5.0 (Linux) Nextcloud-Thunderbird v2.2.0', true], + ['!is', 'ios', 'Filelink for *cloud/2.2.0', true], ['is', 'desktop', 'Mozilla/5.0 (Android) Nextcloud-android/2.2.0', false], ['is', 'desktop', 'Mozilla/5.0 (iOS) Nextcloud-iOS/2.2.0', false], ['is', 'desktop', 'Mozilla/5.0 (Linux) mirall/2.2.0', true], ['is', 'desktop', 'Mozilla/5.0 (Windows) Nextcloud-Outlook v2.2.0', false], - ['is', 'desktop', 'Mozilla/5.0 (Linux) Nextcloud-Thunderbird v2.2.0', false], + ['is', 'desktop', 'Filelink for *cloud/2.2.0', false], ['!is', 'desktop', 'Mozilla/5.0 (Android) Nextcloud-android/2.2.0', true], ['!is', 'desktop', 'Mozilla/5.0 (iOS) Nextcloud-iOS/2.2.0', true], ['!is', 'desktop', 'Mozilla/5.0 (Linux) mirall/2.2.0', false], ['!is', 'desktop', 'Mozilla/5.0 (Windows) Nextcloud-Outlook v2.2.0', true], - ['!is', 'desktop', 'Mozilla/5.0 (Linux) Nextcloud-Thunderbird v2.2.0', true], + ['!is', 'desktop', 'Filelink for *cloud/2.2.0', true], ['is', 'mail', 'Mozilla/5.0 (Android) Nextcloud-android/2.2.0', false], ['is', 'mail', 'Mozilla/5.0 (iOS) Nextcloud-iOS/2.2.0', false], ['is', 'mail', 'Mozilla/5.0 (Linux) mirall/2.2.0', false], ['is', 'mail', 'Mozilla/5.0 (Windows) Nextcloud-Outlook v2.2.0', true], - ['is', 'mail', 'Mozilla/5.0 (Linux) Nextcloud-Thunderbird v2.2.0', true], + ['is', 'mail', 'Filelink for *cloud/2.2.0', true], ['!is', 'mail', 'Mozilla/5.0 (Android) Nextcloud-android/2.2.0', true], ['!is', 'mail', 'Mozilla/5.0 (iOS) Nextcloud-iOS/2.2.0', true], ['!is', 'mail', 'Mozilla/5.0 (Linux) mirall/2.2.0', true], ['!is', 'mail', 'Mozilla/5.0 (Windows) Nextcloud-Outlook v2.2.0', false], - ['!is', 'mail', 'Mozilla/5.0 (Linux) Nextcloud-Thunderbird v2.2.0', false], + ['!is', 'mail', 'Filelink for *cloud/2.2.0', false], ]; } diff --git a/lib/public/IRequest.php b/lib/public/IRequest.php index dedff769f7716..2639a234ad573 100644 --- a/lib/public/IRequest.php +++ b/lib/public/IRequest.php @@ -84,7 +84,7 @@ interface IRequest { * @since 13.0.1 * @since 28.0.0 The regex has a group matching the version number */ - public const USER_AGENT_THUNDERBIRD_ADDON = '/^Mozilla\/5\.0 \([A-Za-z ]+\) Nextcloud\-Thunderbird v([^ ]*).*$/'; + public const USER_AGENT_THUNDERBIRD_ADDON = '/^Filelink for \*cloud\/([1-9]\d*\.\d+\.\d+)$/'; /** * @since 26.0.0 diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php index 1c7f07580cc66..a0851d819de40 100644 --- a/tests/lib/AppFramework/Http/RequestTest.php +++ b/tests/lib/AppFramework/Http/RequestTest.php @@ -1155,7 +1155,7 @@ public function dataMatchClientVersion(): array { '1.0.0', ], [ - 'Mozilla/5.0 (Linux) Nextcloud-Thunderbird v1.0.0', + 'Fielink for *cloud/1.0.0', Request::USER_AGENT_THUNDERBIRD_ADDON, '1.0.0', ],