From fa62d45d00c75904146bbc85b2de91bc85f3e175 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Fri, 22 Dec 2023 01:57:59 +0100 Subject: [PATCH] Update mojang api username filter --- CHANGELOG.md | 3 +++ mojangtextures/mojang_textures.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7e675e..7ff7207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Counters: - `ely.skinsystem.{hostname}.app.profiles.request` +### Fixed +- Adjusted Mojang usernames filter to be stickier according to their docs + ### Changed - Bumped Go version to 1.21. diff --git a/mojangtextures/mojang_textures.go b/mojangtextures/mojang_textures.go index c092169..0e153d9 100644 --- a/mojangtextures/mojang_textures.go +++ b/mojangtextures/mojang_textures.go @@ -60,8 +60,8 @@ func (c *broadcaster) BroadcastAndRemove(username string, result *broadcastResul delete(c.listeners, username) } -// https://help.mojang.com/customer/portal/articles/928638 -var allowedUsernamesRegex = regexp.MustCompile(`^[\w_]{3,16}$`) +// https://help.minecraft.net/hc/en-us/articles/4408950195341#h_01GE5JX1Z0CZ833A7S54Y195KV +var allowedUsernamesRegex = regexp.MustCompile(`(?i)^[0-9a-z_]{3,16}$`) type UUIDsProvider interface { GetUuid(username string) (*mojang.ProfileInfo, error)