0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Merge pull request #6065 from acburdine/export-fix

Fix DB export throwing access denied errors
This commit is contained in:
Sebastian Gierlinger 2015-11-16 10:00:22 +01:00
commit 007c06fdc0
2 changed files with 18 additions and 0 deletions

View file

@ -19,6 +19,8 @@ function isBearerAutorizationHeader(req) {
if (req.headers && req.headers.authorization) {
parts = req.headers.authorization.split(' ');
} else if (req.query && req.query.access_token) {
return true;
} else {
return false;
}

View file

@ -47,4 +47,20 @@ describe('DB API', function () {
done();
});
});
it('should work with access token set as query parameter', function (done) {
request.get(testUtils.API.getApiQuery('db/?access_token=' + accesstoken))
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
var jsonResponse = res.body;
should.exist(jsonResponse.db);
jsonResponse.db.should.have.length(1);
done();
});
});
});