diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-09 12:59:42 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-09 12:59:42 +0300 |
commit | eb34e95fd3525630fba8bb56c2e700a40582cb5d (patch) | |
tree | 003937ac0877ccd94f104e9c188d306c4acf2784 /core | |
parent | 7f3f06cdd9f6ae8c27a96bd5bfd81482c404c511 (diff) |
Use temporary htaccesstest.txt for data dir security check
Diffstat (limited to 'core')
-rw-r--r-- | core/js/setupchecks.js | 4 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 41f6a6e07b6..ee93781b074 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 05be46781d6..9e2f0f49010 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([ |