feat(xo-server/collection/Redis): assert namespace doesnt contain _ or :
This commit is contained in:
parent
67193a2ab7
commit
3ca2b01d9a
@ -1,3 +1,4 @@
|
||||
import assert from 'assert'
|
||||
import asyncMapSettled from '@xen-orchestra/async-map/legacy.js'
|
||||
import difference from 'lodash/difference.js'
|
||||
import filter from 'lodash/filter.js'
|
||||
@ -36,6 +37,9 @@ export default class Redis extends Collection {
|
||||
constructor({ connection, indexes = [], namespace, uri }) {
|
||||
super()
|
||||
|
||||
assert(!namespace.includes(':'), 'namespace must not contains ":": ' + namespace)
|
||||
assert(!namespace.includes('_'), 'namespace must not contains "_": ' + namespace)
|
||||
|
||||
const prefix = 'xo:' + namespace
|
||||
|
||||
this.indexes = indexes
|
||||
|
Loading…
Reference in New Issue
Block a user