mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-11 08:43:39 +00:00
add basic hostname validation for bonjour devices
This commit is contained in:
+23
-9
@@ -126,15 +126,29 @@ function searchBonjour(pluginType, pluginConfig) {
|
||||
}
|
||||
});
|
||||
|
||||
DEVICE.registerDevice(
|
||||
{
|
||||
type: pluginType,
|
||||
defaultName: e.name,
|
||||
port: e.port,
|
||||
addresses: validAddresses,
|
||||
},
|
||||
'fromSearch'
|
||||
);
|
||||
if (pluginConfig.searchOptions.validateResponse) {
|
||||
if (pluginConfig.searchOptions.validateResponse(e.fqdn)) {
|
||||
DEVICE.registerDevice(
|
||||
{
|
||||
type: pluginType,
|
||||
defaultName: e.name,
|
||||
port: e.port,
|
||||
addresses: validAddresses,
|
||||
},
|
||||
'fromSearch'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
DEVICE.registerDevice(
|
||||
{
|
||||
type: pluginType,
|
||||
defaultName: e.name,
|
||||
port: e.port,
|
||||
addresses: validAddresses,
|
||||
},
|
||||
'fromSearch'
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user