diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-08 08:42:11 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-08 08:44:04 +0800 |
commit | c6eacf7ef76fc2aa9a779618220b10ac0448fd6b (patch) | |
tree | 37cc76848049397c2320af0c28bbcfaa59d77290 /tags.go | |
parent | Add LICENSE (diff) | |
download | meseircd-c6eacf7ef76fc2aa9a779618220b10ac0448fd6b.tar.gz meseircd-c6eacf7ef76fc2aa9a779618220b10ac0448fd6b.tar.zst meseircd-c6eacf7ef76fc2aa9a779618220b10ac0448fd6b.zip |
Slight refactor
Diffstat (limited to 'tags.go')
-rw-r--r-- | tags.go | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -32,7 +32,8 @@ func parseTags(tagsString string) (tags map[string]string, err error) { // "Implementations [...] MUST NOT perform any validation that would // reject the message if an invalid tag key name is used." if validateTagName(tagName) { - if !validateTagValue(tagValue) { + // "Tag values MUST be encoded as UTF8." + if !utf8.ValidString(tagValue) { err = ErrInvalidTagContent return } @@ -113,7 +114,3 @@ func validateTagName(name string) bool { return true } -// "Tag values MUST be encoded as UTF8." -func validateTagValue(value string) bool { - return utf8.ValidString(value) -} |