Skip to content

Commit

Permalink
Change UserAgent to *cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
joendres committed Jan 1, 2025
1 parent c54038c commit 215967f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions apps/workflowengine/tests/Check/RequestUserAgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/public/IRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/AppFramework/Http/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
Expand Down

0 comments on commit 215967f

Please sign in to comment.