Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
c79dc0e0
Unverified
Commit
c79dc0e0
authored
7 years ago
by
jaltek
Committed by
Roeland Jago Douma
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Configurable list for opt out from same site cookie protection
Signed-off-by:
Roeland Jago Douma
<
roeland@famdouma.nl
>
parent
ebdd3fb6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/config.sample.php
+10
-0
10 additions, 0 deletions
config/config.sample.php
lib/base.php
+12
-5
12 additions, 5 deletions
lib/base.php
with
22 additions
and
5 deletions
config/config.sample.php
+
10
−
0
View file @
c79dc0e0
...
@@ -1595,4 +1595,14 @@ $CONFIG = array(
...
@@ -1595,4 +1595,14 @@ $CONFIG = array(
*/
*/
'gs.federation'
=>
'internal'
,
'gs.federation'
=>
'internal'
,
/**
* List of incompatible user agents opted out from Same Site Cookie Protection.
* Some user agents are notorious and don't really properly follow HTTP
* specifications. For those, have an opt-out.
*/
'csrf.optout'
=>
array
(
'/^WebDAVFS/'
,
// OS X Finder
'/^Microsoft-WebDAV-MiniRedir/'
,
// Windows webdav drive
),
);
);
This diff is collapsed.
Click to expand it.
lib/base.php
+
12
−
5
View file @
c79dc0e0
...
@@ -523,11 +523,18 @@ class OC {
...
@@ -523,11 +523,18 @@ class OC {
// specifications. For those, have an automated opt-out. Since the protection
// specifications. For those, have an automated opt-out. Since the protection
// for remote.php is applied in base.php as starting point we need to opt out
// for remote.php is applied in base.php as starting point we need to opt out
// here.
// here.
$incompatibleUserAgents
=
[
$incompatibleUserAgents
=
\OC
::
$server
->
getConfig
()
->
getSystemValue
(
'csrf.optout'
);
// OS X Finder
'/^WebDAVFS/'
,
// Fallback, if csrf.optout is unset
'/^Microsoft-WebDAV-MiniRedir/'
,
if
(
!
is_array
(
$incompatibleUserAgents
))
{
];
$incompatibleUserAgents
=
[
// OS X Finder
'/^WebDAVFS/'
,
// Windows webdav drive
'/^Microsoft-WebDAV-MiniRedir/'
,
];
}
if
(
$request
->
isUserAgent
(
$incompatibleUserAgents
))
{
if
(
$request
->
isUserAgent
(
$incompatibleUserAgents
))
{
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment