Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-10 14:33:57 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-10 14:48:56 +0300
commitd143b43a0454528905c751579b4ab482abe39f36 (patch)
treecb1a48e5b88151e041ea9715df9e80d5e3f161c7 /core/js/setupchecks.js
parentf64bd62f8e438fe36a6c070ac445a07ad22439e4 (diff)
Make possible to set the expected status of the well known URL check
The check is based on the HTTP status returned by the URL, and different URLs may return different status (for example, DAV returns 207, while a service like WebFinger would return 200), so the expected status needs to be set depending on the URL. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'core/js/setupchecks.js')
-rw-r--r--core/js/setupchecks.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index 62f0fb10c10..1fe9e770777 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -52,9 +52,14 @@
* @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
+ * @param {int} expectedStatus the expected HTTP status to be returned by the URL, 207 by default
* @return $.Deferred object resolved with an array of error messages
*/
- checkWellKnownUrl: function(url, placeholderUrl, runCheck) {
+ checkWellKnownUrl: function(url, placeholderUrl, runCheck, expectedStatus) {
+ if (expectedStatus === undefined) {
+ expectedStatus = 207;
+ }
+
var deferred = $.Deferred();
if(runCheck === false) {
@@ -63,7 +68,7 @@
}
var afterCall = function(xhr) {
var messages = [];
- if (xhr.status !== 207) {
+ if (xhr.status !== expectedStatus) {
var docUrl = placeholderUrl.replace('PLACEHOLDER', 'admin-setup-well-known-URL');
messages.push({
msg: t('core', 'Your web server is not properly set up to resolve "{url}". Further information can be found in the <a target="_blank" rel="noreferrer noopener" href="{docLink}">documentation</a>.', { docLink: docUrl, url: url }),