mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-11-01 06:51:18 +00:00
ensure federation info fqdn to lowercase
This commit is contained in:
parent
e05c810823
commit
5a7f6f15a6
5 changed files with 24 additions and 6 deletions
|
|
@ -6,6 +6,7 @@ package forgefed
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/modules/validation"
|
||||
|
|
@ -32,7 +33,7 @@ func GetFederationHost(ctx context.Context, ID int64) (*FederationHost, error) {
|
|||
func FindFederationHostByFqdn(ctx context.Context, fqdn string) (*FederationHost, error) {
|
||||
host := new(FederationHost)
|
||||
// TODO: use parameter with toLower
|
||||
has, err := db.GetEngine(ctx).Where("host_fqdn=?", fqdn).Get(host)
|
||||
has, err := db.GetEngine(ctx).Where("host_fqdn=?", strings.ToLower(fqdn)).Get(host)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue