modules/csrf-module.js
function filterByMethods(req) {
        if(_config.allowedMethods) {
            return _config.allowedMethods.indexOf(req.method) > -1;
        } else if(_config.blockedMethods){
            return !(_config.blockedMethods.indexOf(req.method) > -1);
        } else {
            return true;
        }
    }
function filterByMethods(req) {
        if(_config.allowedMethods) {
            return _config.allowedMethods.indexOf(req.method) > -1;
        } else if(_config.blockedMethods){
            return !(_config.blockedMethods.indexOf(req.method) > -1);
        } else {
            return true;
        }
    }
function filterByMethods ( req ) { if ( _config . allowedMethods ) { return _config . allowedMethods . indexOf ( req . method ) > - 1 ; } else if ( _config . blockedMethods ) { return ! ( _config . blockedMethods . indexOf ( req . method ) > - 1 ) ; } else { return true ; } }
This Method checks by configured black or whitelist, if the REST-Method is allowed or not
If no black or whitelist exists it allows method by default
@param req
@returns {boolean}
This Method checks by configured black or whitelist if the REST - Method is allowed or not If no black or whitelist exists it allows method by default