diff options
author | Joas Schilling <coding@schilljs.com> | 2016-10-26 12:07:10 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-10-26 12:07:10 +0200 |
commit | c20ab0049f91cbace09cbec3ce35e9b41515f179 (patch) | |
tree | 73a342c80f4a7b1ebcb80f468f1e415e0230fa90 /lib | |
parent | fdcb8edd78c645e722716fec1d12fa8fac750553 (diff) | |
download | nextcloud-server-c20ab0049f91cbace09cbec3ce35e9b41515f179.tar.gz nextcloud-server-c20ab0049f91cbace09cbec3ce35e9b41515f179.zip |
Identify Chromium as Chrome
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/AppFramework/Http/Request.php | 2 | ||||
-rw-r--r-- | lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index ba8a48381bd..c7a3be163fe 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -61,7 +61,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { // Firefox User Agent from https://developer.mozilla.org/en-US/docs/Web/HTTP/Gecko_user_agent_string_reference const USER_AGENT_FIREFOX = '/^Mozilla\/5\.0 \([^)]+\) Gecko\/[0-9.]+ Firefox\/[0-9.]+$/'; // Chrome User Agent from https://developer.chrome.com/multidevice/user-agent - const USER_AGENT_CHROME = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+$/'; + const USER_AGENT_CHROME = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\)( Ubuntu Chromium\/[0-9.]+|) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+$/'; // Safari User Agent from http://www.useragentstring.com/pages/Safari/ const USER_AGENT_SAFARI = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Version\/[0-9.]+ Safari\/[0-9.A-Z]+$/'; // Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent diff --git a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php index e6a39b12a42..284700566d6 100644 --- a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php +++ b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php @@ -21,6 +21,7 @@ namespace OC\Security\CSP; +use OC\AppFramework\Http\Request; use OC\Security\CSRF\CsrfTokenManager; use OCP\IRequest; @@ -65,8 +66,7 @@ class ContentSecurityPolicyNonceManager { */ public function browserSupportsCspV3() { $browserWhitelist = [ - // Chrome 40+ - '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/[4-9][0-9].[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+$/', + Request::USER_AGENT_CHROME, // Firefox 45+ '/^Mozilla\/5\.0 \([^)]+\) Gecko\/[0-9.]+ Firefox\/(4[5-9]|[5-9][0-9])\.[0-9.]+$/', // Safari 10+ |