Skyost / Bonsoir

A Zeroconf library that allows you to discover network services and to broadcast your own. Based on Apple Bonjour and Android NSD.
http://bonsoir.skyost.eu/
Other
100 stars 43 forks source link

Resolver cuts attribute keys to 9 characters #74

Closed julianscheel closed 6 months ago

julianscheel commented 6 months ago

Describe the bug The normalizeAttributes functions cuts attribute keys down to 9 keys. The RFC says ''The key SHOULD be no more than nine characters long.". As it's a "SHOULD" and not a "MUST", I think it's not correct to strictly enforce this.

To Reproduce Discover any service, which has a TXT attribute with a key longer then 9 characters. After "discovery" the full key is shown, after "resolve" the key is cut down to the leading 9 characters.

Expected behavior Always expose the full attribute key, even if the service is not following the the RFC suggestion.

Additional context This is not platform specific, but implemented in the core code.

Skyost commented 6 months ago

In fact, I think you're right. Maybe we should leave this as an option via an optional parameter for example (as the BonsoirServiceNormalizer class is accessible).