diff --git a/packages/bonsoir_platform_interface/lib/src/service/normalizer.dart b/packages/bonsoir_platform_interface/lib/src/service/normalizer.dart index fef32717..04147a3a 100644 --- a/packages/bonsoir_platform_interface/lib/src/service/normalizer.dart +++ b/packages/bonsoir_platform_interface/lib/src/service/normalizer.dart @@ -77,7 +77,7 @@ class BonsoirServiceNormalizer { /// Normalizes a given service [attributes]. /// /// Reference : [RFC 6763](https://datatracker.ietf.org/doc/html/rfc6763#section-6). - static Map normalizeAttributes(Map attributes) { + static Map normalizeAttributes(Map attributes, { bool limitKeyLength = false }) { Map result = {}; for (MapEntry entry in attributes.entries) { @@ -87,7 +87,7 @@ class BonsoirServiceNormalizer { key = key.replaceAll('=', ''); // The key SHOULD be no more than nine characters long. - if (key.length >= 9) { + if (limitKeyLength && key.length >= 9) { key = key.substring(0, 9); }