summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-09 11:58:28 +0200
committerVincent Petry <pvince81@owncloud.com>2016-06-09 11:58:28 +0200
commit90c1ec1c49798232c0c1303ccbddacac536b5768 (patch)
treec7541d23b30327be5d911f4a8701b4c241483bf3 /core
parent826e276a79c29314e4d8dc243031bf6cd718acdc (diff)
parentfb087a026167d0c0db4af9634657a52dfaf011de (diff)
downloadnextcloud-server-90c1ec1c49798232c0c1303ccbddacac536b5768.tar.gz
nextcloud-server-90c1ec1c49798232c0c1303ccbddacac536b5768.zip
Merge pull request #25014 from owncloud/admin-datadircheck-fix
Use temporary htaccesstest.txt for data dir security check
Diffstat (limited to 'core')
-rw-r--r--core/js/setupchecks.js4
-rw-r--r--core/js/tests/specs/setupchecksSpec.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index 4cc50e51ae6..f987c9f04e6 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -197,7 +197,7 @@
}
var afterCall = function(xhr) {
var messages = [];
- if (xhr.status !== 403 && xhr.status !== 307 && xhr.status !== 301 && xhr.responseText === '') {
+ if (xhr.status !== 403 && xhr.status !== 307 && xhr.status !== 301 && xhr.responseText !== '') {
messages.push({
msg: t('core', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.'),
type: OC.SetupChecks.MESSAGE_TYPE_ERROR
@@ -208,7 +208,7 @@
$.ajax({
type: 'GET',
- url: OC.linkTo('', oc_dataURL+'/.ocdata'),
+ url: OC.linkTo('', oc_dataURL+'/htaccesstest.txt?t=' + (new Date()).getTime()),
complete: afterCall
});
return deferred.promise();
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index 4931ca990da..172e6e27135 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -103,7 +103,7 @@ describe('OC.SetupChecks tests', function() {
it('should return an error if data directory is not protected', function(done) {
var async = OC.SetupChecks.checkDataProtected();
- suite.server.requests[0].respond(200);
+ suite.server.requests[0].respond(200, {'Content-Type': 'text/plain'}, 'file contents');
async.done(function( data, s, x ){
expect(data).toEqual([