Skip to content

Commit

Permalink
Allow Authorization header. Closes #99
Browse files Browse the repository at this point in the history
  • Loading branch information
rictorres committed Apr 11, 2018
1 parent 8b68997 commit 43dfe27
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/constants.js
Expand Up @@ -8,6 +8,7 @@ const REQUEST_METHODS = [
];

const HEADERS = [
'Authorization',
'Content-Type',
'Location',
'Tus-Extension',
Expand Down
3 changes: 3 additions & 0 deletions lib/validators/RequestValidator.js
Expand Up @@ -67,6 +67,9 @@ class RequestValidator {
return value !== 'application/offset+octet-stream';
}

static _invalidAuthorizationHeader() {
return false;
}

static capitalizeHeader(header_name) {
return header_name.replace(/\b[a-z]/g, function() {
Expand Down
7 changes: 7 additions & 0 deletions test/Test-RequestValidator.js
Expand Up @@ -142,6 +142,13 @@ describe('RequestValidator', () => {
});
});

describe('_invalidAuthorizationHeader', () => {
it('always validate ', (done) => {
assert.equal(RequestValidator._invalidAuthorizationHeader(), false);
done();
});
});

describe('_invalidContentTypeHeader', () => {
it('should validate octet-stream', (done) => {
assert.equal(RequestValidator._invalidContentTypeHeader('application/offset+octet-stream'), false);
Expand Down

0 comments on commit 43dfe27

Please sign in to comment.