summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-01-12 09:53:23 +0100
committerMorris Jobke <hey@morrisjobke.de>2016-01-12 09:53:23 +0100
commit8b6b042ffde9490c24a1689919dbc6678381239c (patch)
tree1b5f30630887c44dcde93beaff08db3d199496ca /core
parent3317dd0a8e2ca265172d53a16f9241f3351aa3b8 (diff)
downloadnextcloud-server-8b6b042ffde9490c24a1689919dbc6678381239c.tar.gz
nextcloud-server-8b6b042ffde9490c24a1689919dbc6678381239c.zip
Add config switch to disable the .well-known URL check
Diffstat (limited to 'core')
-rw-r--r--core/js/setupchecks.js8
-rw-r--r--core/js/tests/specs/setupchecksSpec.js13
2 files changed, 18 insertions, 3 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index b1b8dd358d2..d178a7432b0 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -51,10 +51,16 @@
*
* @param url the URL to test
* @param placeholderUrl the placeholder URL - can be found at oc_defaults.docPlaceholderUrl
+ * @param {boolean} runCheck if this is set to false the check is skipped and no error is returned
* @return $.Deferred object resolved with an array of error messages
*/
- checkWellKnownUrl: function(url, placeholderUrl) {
+ checkWellKnownUrl: function(url, placeholderUrl, runCheck) {
var deferred = $.Deferred();
+
+ if(runCheck === false) {
+ deferred.resolve([]);
+ return deferred.promise();
+ }
var afterCall = function(xhr) {
var messages = [];
if (xhr.status !== 207) {
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index 18ba44ac61b..97f624cecaf 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -62,7 +62,7 @@ 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');
+ var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav/', 'http://example.org/PLACEHOLDER', true);
suite.server.requests[0].respond(200);
@@ -76,7 +76,7 @@ describe('OC.SetupChecks tests', function() {
});
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');
+ var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav/', 'http://example.org/PLACEHOLDER', true);
suite.server.requests[0].respond(207);
@@ -85,6 +85,15 @@ describe('OC.SetupChecks tests', function() {
done();
});
});
+
+ it('should return no error when no check should be run', function(done) {
+ var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav/', 'http://example.org/PLACEHOLDER', false);
+
+ async.done(function( data, s, x ){
+ expect(data).toEqual([]);
+ done();
+ });
+ });
});
describe('checkSetup', function() {