Skip to content

Commit ca70ad0

Browse files
author
Arthur Cinader
committed
Add a unit test to fail when clientKey=''
1 parent 5b71441 commit ca70ad0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spec/Middlewares.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,19 @@ describe('middlewares', () => {
7979
});
8080
});
8181

82+
it('should succeed when client key supplied but empty', (done) => {
83+
AppCache.put(fakeReq.body._ApplicationId, {
84+
clientKey: '',
85+
masterKey: 'masterKey',
86+
restAPIKey: 'restAPIKey'
87+
});
88+
fakeReq.headers['x-parse-client-key'] = '';
89+
middlewares.handleParseHeaders(fakeReq, fakeRes, () => {
90+
expect(fakeRes.status).not.toHaveBeenCalled();
91+
done();
92+
});
93+
});
94+
8295
it('should succeed when no keys are configured and none supplied', (done) => {
8396
AppCache.put(fakeReq.body._ApplicationId, {
8497
masterKey: 'masterKey'

0 commit comments

Comments
 (0)