Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions core/js/setupchecks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 }),
Expand Down
3 changes: 2 additions & 1 deletion public.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
OC_App::loadApps(array('filesystem', 'logging'));

if (!\OC::$server->getAppManager()->isInstalled($app)) {
throw new Exception('App not installed: ' . $app);
http_response_code(501);
exit;
}
OC_App::loadApp($app);
OC_User::setIncognitoMode(true);
Expand Down
2 changes: 1 addition & 1 deletion settings/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ $(document).ready(function(){
// run setup checks then gather error messages
$.when(
OC.SetupChecks.checkWebDAV(),
OC.SetupChecks.checkWellKnownUrl('/.well-known/webfinger', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true && !!oc_appconfig.core.public_webfinger, 200),
OC.SetupChecks.checkWellKnownUrl('/.well-known/webfinger', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true && !!oc_appconfig.core.public_webfinger, [200, 501]),
OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),
OC.SetupChecks.checkWellKnownUrl('/.well-known/carddav', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),
OC.SetupChecks.checkSetup(),
Expand Down