mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-28 15:23:32 -06:00
[chore] better dns validation (#3644)
* add seperate PunifyValidate() function for properly validating domain names when converting to punycode * rename function, strip port from domain validation
This commit is contained in:
parent
b95498b8c2
commit
e77c7e16b6
10 changed files with 203 additions and 173 deletions
|
|
@ -137,8 +137,9 @@ func (a *accountDB) GetAccountByURL(ctx context.Context, url string) (*gtsmodel.
|
|||
|
||||
func (a *accountDB) GetAccountByUsernameDomain(ctx context.Context, username string, domain string) (*gtsmodel.Account, error) {
|
||||
if domain != "" {
|
||||
// Normalize the domain as punycode
|
||||
var err error
|
||||
|
||||
// Normalize the domain as punycode
|
||||
domain, err = util.Punify(domain)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue