diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-01-08 22:32:11 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-01-08 23:27:29 +0100 |
commit | 0161928fc3a472c35fb571c732408f088292052d (patch) | |
tree | 7059312cf069500c8f1fc7fb06032c936aa0dc0f /core/js/setupchecks.js | |
parent | a259effc7d22cfd686ac73744caf2ce209ac1f1f (diff) | |
download | nextcloud-server-0161928fc3a472c35fb571c732408f088292052d.tar.gz nextcloud-server-0161928fc3a472c35fb571c732408f088292052d.zip |
Add check for .well-known URL in the root of the webservers URL
* fixes #20012
Diffstat (limited to 'core/js/setupchecks.js')
-rw-r--r-- | core/js/setupchecks.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 8763ec1c71b..b1b8dd358d2 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -47,6 +47,35 @@ }, /** + * 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 <a target="_blank" href="{docLink}">documentation</a>.', { 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 * * @return $.Deferred object resolved with an array of error messages |