Fix escaping issues with spaces in server names

Fixes #320
This commit is contained in:
Andrew Steinborn
2020-06-23 16:07:06 -04:00
parent 31a7e22719
commit 514d2ce010

View File

@@ -212,8 +212,8 @@ public abstract class AnnotatedConfig {
}
protected static String escapeKeyIfNeeded(String key) {
if (key.contains(".") && !(key.indexOf('"') == 0 && key.lastIndexOf('"') == (key.length()
- 1))) {
if ((key.contains(".") || key.contains(" "))
&& !(key.indexOf('"') == 0 && key.lastIndexOf('"') == (key.length() - 1))) {
return '"' + key + '"';
}
return key;