WebDAV enable CORS

The discussion room of webDAV based solution for file sharing.
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/support_form.php?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
rchristian
I'm New!
I'm New!
Posts: 3
Joined: Fri Nov 07, 2014 8:07 pm

WebDAV enable CORS

Postby rchristian » Mon Mar 06, 2017 12:37 pm

I want to run KeeWeb on my Synology NAS with the option to save the password-file on a WebDAV.
So I installed the WebDAV Server from the Synology Package.

If I try to access the WebDAV directory from the KeeWeb-Application I get following error-Message: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource"
Is there a way to activate CORS for WebDAV?

I tried to login via SSH and added following lines to the httpd conf file (/var/packages/WebDAVServer/target/etc/httpd/conf/httpd.conf-webdav)

Code: Select all

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Headers "origin, content-type, cache-control, accept, authorization, if-match, destination, overwrite"
Header always set Access-Control-Expose-Headers "ETag"
Header always set Access-Control-Allow-Methods "GET, HEAD, POST, PUT, OPTIONS, MOVE, DELETE, COPY, LOCK, UNLOCK"
Header always set Access-Control-Allow-Credentials "true"

RewriteEngine on
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ blank.html [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]


But after editing I wasn't able to access the webDAV directory.

Can anyone help me with this problem?
alebupal
I'm New!
I'm New!
Posts: 2
Joined: Thu Nov 09, 2017 8:58 pm

Re: WebDAV enable CORS

Postby alebupal » Thu Nov 09, 2017 9:01 pm

rchristian wrote:I want to run KeeWeb on my Synology NAS with the option to save the password-file on a WebDAV.
So I installed the WebDAV Server from the Synology Package.

If I try to access the WebDAV directory from the KeeWeb-Application I get following error-Message: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource"
Is there a way to activate CORS for WebDAV?

I tried to login via SSH and added following lines to the httpd conf file (/var/packages/WebDAVServer/target/etc/httpd/conf/httpd.conf-webdav)

Code: Select all

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Headers "origin, content-type, cache-control, accept, authorization, if-match, destination, overwrite"
Header always set Access-Control-Expose-Headers "ETag"
Header always set Access-Control-Allow-Methods "GET, HEAD, POST, PUT, OPTIONS, MOVE, DELETE, COPY, LOCK, UNLOCK"
Header always set Access-Control-Allow-Credentials "true"

RewriteEngine on
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ blank.html [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]


But after editing I wasn't able to access the webDAV directory.

Can anyone help me with this problem?

I have same problem.
Have you finally found a solution?
alebupal
I'm New!
I'm New!
Posts: 2
Joined: Thu Nov 09, 2017 8:58 pm

Re: WebDAV enable CORS

Postby alebupal » Fri Nov 10, 2017 12:26 pm


Return to “WebDAV”

Who is online

Users browsing this forum: No registered users and 1 guest