summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-12-18 19:53:18 +0100
committerJulius Härtl <jus@bitgrid.net>2018-12-19 07:41:25 +0100
commita3be28627364342ac3373075a0f4a7d1688c49f2 (patch)
tree857589a3b41b70dd385573b220cfeafec3d3f19c /core
parentfb7840b283e3033b18869adf09cb2e66e4b2485d (diff)
downloadnextcloud-server-a3be28627364342ac3373075a0f4a7d1688c49f2.tar.gz
nextcloud-server-a3be28627364342ac3373075a0f4a7d1688c49f2.zip
Make setup check also pass with a 501 status
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'core')
-rw-r--r--core/js/setupchecks.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index 343b676080a..025f58bca8a 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -52,12 +52,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
- * @param {int} expectedStatus the expected HTTP status to be returned by the URL, 207 by default
+ * @param {int|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, expectedStatus) {
if (expectedStatus === undefined) {
- expectedStatus = 207;
+ expectedStatus = [207];
+ }
+
+ if (!Array.isArray(expectedStatus)) {
+ expectedStatus = [expectedStatus];
}
var deferred = $.Deferred();
@@ -68,7 +72,7 @@
}
var afterCall = function(xhr) {
var messages = [];
- if (xhr.status !== expectedStatus) {
+ if (expectedStatus.indexOf(xhr.status) === -1) {
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 }),