Merge pull request #7467 from nextcloud/update-user-agent-regex-stable11
allow 'Nextcloud' in the user agent string of Android
This commit is contained in:
commit
1bdb2608a3
|
@ -301,7 +301,7 @@ class AuthTest extends TestCase {
|
|||
->method('isUserAgent')
|
||||
->with([
|
||||
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
||||
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
||||
'/^Mozilla\/5\.0 \(Android\) (ownCloud|Nextcloud)\-android.*$/',
|
||||
'/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/',
|
||||
])
|
||||
->willReturn(false);
|
||||
|
@ -405,7 +405,7 @@ class AuthTest extends TestCase {
|
|||
->method('isUserAgent')
|
||||
->with([
|
||||
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
||||
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
||||
'/^Mozilla\/5\.0 \(Android\) (ownCloud|Nextcloud)\-android.*$/',
|
||||
'/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/',
|
||||
])
|
||||
->willReturn(false);
|
||||
|
@ -451,7 +451,7 @@ class AuthTest extends TestCase {
|
|||
->method('isUserAgent')
|
||||
->with([
|
||||
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
||||
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
||||
'/^Mozilla\/5\.0 \(Android\) (ownCloud|Nextcloud)\-android.*$/',
|
||||
'/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/',
|
||||
])
|
||||
->willReturn(true);
|
||||
|
|
|
@ -66,7 +66,7 @@ interface IRequest {
|
|||
/**
|
||||
* @since 9.1.0
|
||||
*/
|
||||
const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/';
|
||||
const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) (ownCloud|Nextcloud)\-android.*$/';
|
||||
|
||||
/**
|
||||
* @since 9.1.0
|
||||
|
|
|
@ -856,6 +856,20 @@ class RequestTest extends \Test\TestCase {
|
|||
],
|
||||
false,
|
||||
],
|
||||
[
|
||||
'Mozilla/5.0 (Android) ownCloud-android/2.0.0',
|
||||
[
|
||||
Request::USER_AGENT_CLIENT_ANDROID
|
||||
],
|
||||
true,
|
||||
],
|
||||
[
|
||||
'Mozilla/5.0 (Android) Nextcloud-android/2.0.0',
|
||||
[
|
||||
Request::USER_AGENT_CLIENT_ANDROID
|
||||
],
|
||||
true,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue