diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-12-18 13:34:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 13:34:04 +0100 |
commit | f37e150d1caa0918e3258011f3c9b04ce469bb7c (patch) | |
tree | 24eca361971f6ea7e3c586927105da40c8ef8c44 /core/js/setupchecks.js | |
parent | fbf25e164d1d508b4e587ebd454f18382d1917ba (diff) | |
parent | 6995223b1ed202c7f8e920e83cb5b53efd7ce761 (diff) | |
download | nextcloud-server-f37e150d1caa0918e3258011f3c9b04ce469bb7c.tar.gz nextcloud-server-f37e150d1caa0918e3258011f3c9b04ce469bb7c.zip |
Merge pull request #24702 from nextcloud/enhancement/well-known-handler-api
Add well known handlers API
Diffstat (limited to 'core/js/setupchecks.js')
-rw-r--r-- | core/js/setupchecks.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index ba1845a6aa1..9d3f1ddc508 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -56,7 +56,7 @@ * @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) { + checkWellKnownUrl: function(verb, url, placeholderUrl, runCheck, expectedStatus, checkCustomHeader) { if (expectedStatus === undefined) { expectedStatus = [207]; } @@ -73,7 +73,8 @@ } var afterCall = function(xhr) { var messages = []; - if (expectedStatus.indexOf(xhr.status) === -1) { + var customWellKnown = xhr.getResponseHeader('X-NEXTCLOUD-WELL-KNOWN') + if (expectedStatus.indexOf(xhr.status) === -1 || (checkCustomHeader && !customWellKnown)) { 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 }), @@ -84,7 +85,7 @@ }; $.ajax({ - type: 'PROPFIND', + type: verb, url: url, complete: afterCall, allowAuthErrors: true |