feat: ldap module + deps upgrade

This commit is contained in:
Nick committed 2019-04-26 23:59:35 -04:00
1 parent db14239eba
commit 26c7d49a78
9 files changed
+184 -128

No files matched your search

+7 -2
View File
@@ -5,6 +5,8 @@ const crypto = require('crypto')
const localeSegmentRegex = /^[A-Z]{2}(-[A-Z]{2})?$/gi
const systemSegmentRegex = /^[A-Z]\//gi
/* global WIKI */
module.exports = {
/**
* Parse raw url path and make it safe
@@ -63,7 +65,10 @@ module.exports = {
/**
* Check if path is a reserved path
*/
isReservedPath(rawPath)  {
return _.some(WIKI.data.reservedPaths, p => _.startsWith(rawPath, p)) || systemSegmentRegex.test(rawPath)
isReservedPath(rawPath) {
const firstSection = _.head(rawPath.split('/'))
return _.some(WIKI.data.reservedPaths, p => {
return p === firstSection || systemSegmentRegex.test(rawPath)
})
}
}