diff --git a/core/js/config.php b/core/js/config.php
index c975c6db2d..7216c50afa 100644
--- a/core/js/config.php
+++ b/core/js/config.php
@@ -166,6 +166,7 @@ $array = array(
'baseUrl' => $defaults->getBaseUrl(),
'syncClientUrl' => $defaults->getSyncClientUrl(),
'docBaseUrl' => $defaults->getDocBaseUrl(),
+ 'docPlaceholderUrl' => $defaults->buildDocLinkToKey('PLACEHOLDER'),
'slogan' => $defaults->getSlogan(),
'logoClaim' => $defaults->getLogoClaim(),
'shortFooter' => $defaults->getShortFooter(),
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index 8763ec1c71..b1b8dd358d 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -46,6 +46,35 @@
return deferred.promise();
},
+ /**
+ * Check whether the .well-known URLs works.
+ *
+ * @param url the URL to test
+ * @param placeholderUrl the placeholder URL - can be found at oc_defaults.docPlaceholderUrl
+ * @return $.Deferred object resolved with an array of error messages
+ */
+ checkWellKnownUrl: function(url, placeholderUrl) {
+ var deferred = $.Deferred();
+ var afterCall = function(xhr) {
+ var messages = [];
+ if (xhr.status !== 207) {
+ var docUrl = placeholderUrl.replace('PLACEHOLDER', 'admin-setup-well-known-URL');
+ messages.push({
+ msg: t('core', 'Your web server is not set up properly to resolve "{url}". Further information can be found in our documentation.', { docLink: docUrl, url: url }),
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ });
+ }
+ deferred.resolve(messages);
+ };
+
+ $.ajax({
+ type: 'PROPFIND',
+ url: url,
+ complete: afterCall
+ });
+ return deferred.promise();
+ },
+
/**
* Runs setup checks on the server side
*
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index c5f1aa5eff..18ba44ac61 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -60,6 +60,33 @@ describe('OC.SetupChecks tests', function() {
});
});
+ describe('checkWellKnownUrl', function() {
+ it('should fail with another response status code than 207', function(done) {
+ var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav/', 'http://example.org/PLACEHOLDER');
+
+ suite.server.requests[0].respond(200);
+
+ async.done(function( data, s, x ){
+ expect(data).toEqual([{
+ msg: 'Your web server is not set up properly to resolve "/.well-known/caldav/". Further information can be found in our documentation.',
+ type: OC.SetupChecks.MESSAGE_TYPE_ERROR
+ }]);
+ done();
+ });
+ });
+
+ it('should return no error with a response status code of 207', function(done) {
+ var async = OC.SetupChecks.checkWebDAV('/.well-known/caldav/', 'http://example.org/PLACEHOLDER');
+
+ suite.server.requests[0].respond(207);
+
+ async.done(function( data, s, x ){
+ expect(data).toEqual([]);
+ done();
+ });
+ });
+ });
+
describe('checkSetup', function() {
it('should return an error if server has no internet connection', function(done) {
var async = OC.SetupChecks.checkSetup();
diff --git a/settings/js/admin.js b/settings/js/admin.js
index eb3b756bf0..644b773d7b 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -168,6 +168,8 @@ $(document).ready(function(){
// run setup checks then gather error messages
$.when(
OC.SetupChecks.checkWebDAV(),
+ OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav/', oc_defaults.docPlaceholderUrl),
+ OC.SetupChecks.checkWellKnownUrl('/.well-known/carddav/', oc_defaults.docPlaceholderUrl),
OC.SetupChecks.checkSetup(),
OC.SetupChecks.checkGeneric()
).then(function(check1, check2, check3) {