Searching by MAC now works regardless of whether the device's MAC is lower or upper case.
This commit is contained in:
1 parent
f0a1289818
commit
00987ea8e2
2 files changed
+9
-9
No files matched your search
@@ -27,7 +27,7 @@ common = require './common'
|
||||
parameters = require './parameters'
|
||||
|
||||
|
||||
stringToRegexp = (input) ->
|
||||
stringToRegexp = (input, flags) ->
|
||||
if (input.indexOf('*') == -1)
|
||||
return false
|
||||
|
||||
@@ -44,7 +44,7 @@ stringToRegexp = (input) ->
|
||||
|
||||
output = output.replace(/[\*]/, '.*')
|
||||
|
||||
return new RegExp(output)
|
||||
return new RegExp(output, flags)
|
||||
|
||||
|
||||
normalizers = {}
|
||||
@@ -117,14 +117,14 @@ normalizers.mac = (input, normType) ->
|
||||
|
||||
if input.indexOf('*') != -1
|
||||
input = (colonizeMac(a) for a in input.split('*')).join('*')
|
||||
return stringToRegexp(input, false)
|
||||
return stringToRegexp(input, 'i')
|
||||
|
||||
input = colonizeMac(input)
|
||||
|
||||
if input.length == 17
|
||||
return input
|
||||
return [input, input.toLowerCase()]
|
||||
|
||||
return {'$regex' : new RegExp(input)}
|
||||
return {'$regex' : new RegExp(input, 'i')}
|
||||
|
||||
|
||||
exports.normalize = (path, value, normType) ->
|
||||
|
||||
Reference in new issue
Block a user