WebDAV enable CORS

The discussion room of webDAV based solution for file sharing.
Forum rules
Synology Community is the new platform for the enthusiasts' interaction, and it will soon be available to replace the Forum.
rchristian
I'm New!
I'm New!
Posts: 3
Joined: Fri Nov 07, 2014 8:07 pm

WebDAV enable CORS

Unread post by 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

Unread post by 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

Unread post by alebupal » Fri Nov 10, 2017 12:26 pm


Post Reply

Return to “WebDAV”