Merge pull request #18 from mcstatus-io/v3

Allow underscores in server addresses
This commit is contained in:
Jacob 2024-08-16 07:57:42 -05:00 committed by GitHub
commit 4fc00f570a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,7 +25,7 @@ import (
var ( var (
blockedServers *MutexArray[string] = nil blockedServers *MutexArray[string] = nil
hostRegEx *regexp.Regexp = regexp.MustCompile(`^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)+(:\d{1,5})?$`) hostRegEx *regexp.Regexp = regexp.MustCompile(`^[A-Za-z0-9-_]+(\.[A-Za-z0-9-_]+)+(:\d{1,5})?$`)
ipAddressRegEx *regexp.Regexp = regexp.MustCompile(`^\d{1,3}(\.\d{1,3}){3}$`) ipAddressRegEx *regexp.Regexp = regexp.MustCompile(`^\d{1,3}(\.\d{1,3}){3}$`)
) )