Skip to content

Commit

Permalink
chore(platform_interface): Attributes keys are no longer limited to 9…
Browse files Browse the repository at this point in the history
… characters by default.

Closes #74.
  • Loading branch information
Skyost committed Dec 15, 2023
1 parent a7de506 commit 421fe69
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -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<String, String> normalizeAttributes(Map<String, String> attributes) {
static Map<String, String> normalizeAttributes(Map<String, String> attributes, { bool limitKeyLength = false }) {
Map<String, String> result = <String, String>{};

for (MapEntry<String, String> entry in attributes.entries) {
Expand All @@ -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);
}

Expand Down

0 comments on commit 421fe69

Please sign in to comment.