mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-926: Ensure that parameters and attributes are cast to strings.
This commit is contained in:
@@ -477,9 +477,17 @@ angular.module('import').factory('connectionParseService',
|
||||
|
||||
_.forEach(connection.parameters, (value, name) => {
|
||||
|
||||
// An explicit null value for a parameter is valid - do not
|
||||
// process it further
|
||||
if (value === null)
|
||||
return;
|
||||
|
||||
// All non-null connection parameters must be strings.
|
||||
const stringValue = String(value);
|
||||
|
||||
// Convert the provided value to the format that would match
|
||||
// the lookup object format
|
||||
const comparisonValue = value.toLowerCase().trim();
|
||||
const comparisonValue = stringValue.toLowerCase().trim();
|
||||
|
||||
// The validated / corrected option value for this connection
|
||||
// parameter, if any
|
||||
@@ -491,6 +499,22 @@ angular.module('import').factory('connectionParseService',
|
||||
if (validOptionValue)
|
||||
connection.parameters[name] = validOptionValue;
|
||||
|
||||
// Even if no option is found, the value must be a string
|
||||
else
|
||||
connection.parameters[name] = stringValue;
|
||||
|
||||
});
|
||||
|
||||
_.forEach(connection.attributes, (value, name) => {
|
||||
|
||||
// An explicit null value for an attribute is valid - do not
|
||||
// process it further
|
||||
if (value === null)
|
||||
return;
|
||||
|
||||
// All non-null connection attributes must be strings
|
||||
connection.attributes[name] = String(value);
|
||||
|
||||
});
|
||||
|
||||
return connection;
|
||||
|
Reference in New Issue
Block a user