Skip to content

Commit

Permalink
Update mojang api username filter
Browse files Browse the repository at this point in the history
  • Loading branch information
erickskrauch committed Dec 22, 2023
1 parent cadb89f commit fa62d45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions mojangtextures/mojang_textures.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fa62d45

Please sign in to comment.