summaryrefslogtreecommitdiff
path: root/internal/db/bundb/domain.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/bundb/domain.go')
-rw-r--r--internal/db/bundb/domain.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/db/bundb/domain.go b/internal/db/bundb/domain.go
index 417b2becd..e63a584bd 100644
--- a/internal/db/bundb/domain.go
+++ b/internal/db/bundb/domain.go
@@ -21,6 +21,7 @@ package bundb
import (
"context"
"net/url"
+ "strings"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
@@ -39,7 +40,8 @@ func (d *domainDB) IsDomainBlocked(ctx context.Context, domain string) (bool, db
q := d.conn.
NewSelect().
Model(&gtsmodel.DomainBlock{}).
- Where("LOWER(domain) = LOWER(?)", domain).
+ ExcludeColumn("id", "created_at", "updated_at", "created_by_account_id", "private_comment", "public_comment", "obfuscate", "subscription_id").
+ Where("domain = ?", domain).
Limit(1)
return d.conn.Exists(ctx, q)
@@ -50,7 +52,7 @@ func (d *domainDB) AreDomainsBlocked(ctx context.Context, domains []string) (boo
uniqueDomains := util.UniqueStrings(domains)
for _, domain := range uniqueDomains {
- if blocked, err := d.IsDomainBlocked(ctx, domain); err != nil {
+ if blocked, err := d.IsDomainBlocked(ctx, strings.ToLower(domain)); err != nil {
return false, err
} else if blocked {
return blocked, nil