Skip to content

Commit

Permalink
Merge fcb895f into 6d571cb
Browse files Browse the repository at this point in the history
  • Loading branch information
djsg committed Jul 31, 2018
2 parents 6d571cb + fcb895f commit e55aec1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/validators/RequestValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* @author Ben Stahl <bhstahl@gmail.com>
*/

const debug = require('debug');
const log = debug('tus-node-server');

const CONSTANTS = require('../constants');

Expand Down Expand Up @@ -35,7 +37,16 @@ class RequestValidator {
const keypairs = value.split(',')
.map((keypair) => keypair.trim());

// Original code: check key/value pair. If value is empty, return true.
return keypairs.some((keypair) => keypair.split(' ').length !== 2);

// for (let i = 0; i < keypairs.length; i++) {
// if (keypairs[i].split(' ').length !== 2) {
// log('Empty Metadata: ${keypairs[i]}');
// }
// }

return false;
}

static _invalidXRequestedWithHeader() {
Expand Down

0 comments on commit e55aec1

Please sign in to comment.