summaryrefslogtreecommitdiff
path: root/internal/processing/search.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-05-24 13:38:11 +0200
committerLibravatar GitHub <noreply@github.com>2022-05-24 13:38:11 +0200
commit2d748a68aee1d3d013f1779602a9267e5d45324a (patch)
treefb3d5f8999976fd85c383f3f2317758cb61e932e /internal/processing/search.go
parent[bugfix] Set refetch to true in iterateDescendants (#600) (diff)
downloadgotosocial-2d748a68aee1d3d013f1779602a9267e5d45324a.tar.xz
[bugfix] Only search remote if protocol is http(s) (#601)
Diffstat (limited to 'internal/processing/search.go')
-rw-r--r--internal/processing/search.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/processing/search.go b/internal/processing/search.go
index 03f158187..dd2f88424 100644
--- a/internal/processing/search.go
+++ b/internal/processing/search.go
@@ -65,9 +65,9 @@ func (p *processor) SearchGet(ctx context.Context, authed *oauth.Auth, searchQue
}
}
- // check if the query is a URI and just do a lookup for that, straight up
+ // check if the query is a URI with a recognizable scheme and just do a lookup for that, straight up
if !foundOne {
- if uri, err := url.Parse(query); err == nil {
+ if uri, err := url.Parse(query); err == nil && (uri.Scheme == "https" || uri.Scheme == "http") {
// 1. check if it's a status
if foundStatus, err := p.searchStatusByURI(ctx, authed, uri, searchQuery.Resolve); err == nil && foundStatus != nil {
foundStatuses = append(foundStatuses, foundStatus)
@@ -201,8 +201,10 @@ func (p *processor) searchAccountByMention(ctx context.Context, authed *oauth.Au
return nil, fmt.Errorf("error fingering remote account with username %s and domain %s: %s", username, domain, err)
}
- // return the attempt to get the remove account
- return p.federator.GetRemoteAccount(ctx, authed.Account.Username, acctURI, true, true)
+ if acctURI.Scheme == "https" || acctURI.Scheme == "http" {
+ // return the attempt to get the remove account
+ return p.federator.GetRemoteAccount(ctx, authed.Account.Username, acctURI, true, true)
+ }
}
return nil, nil